Supervisor for Object-Oriented Programming

Computer Science tripos, University of Cambridge, 2024

Supervised 3 groups in Michaelmas 2024.

Syllabus

Types, Objects and Classes Moving from functional to imperative. Functions, methods. Control flow. values, variables and types. Primitive Types. Classes as custom types. Objects vs Classes. Class definition, constructors. Static data and methods.

Designing Classes Identifying classes. UML class diagrams. Modularity. Encapsulation/data hiding. Immutability. Access modifiers. Parameterised types (Generics).

Pointers, References and Memory Pointers and references. Reference types in Java. The call stack. The heap. Iteration and recursion. Pass-by-value and pass-by-reference.

Inheritance. Casting. Shadowing. Overloading. Overriding. Abstract Methods and Classes.

Polymorphism and Multiple Inheritance Polymorphism in ML and Java. Multiple inheritance. Interfaces in Java.

Lifecycle of an Object Constructors and chaining. Destructors. Finalizers. Garbage Collection: reference counting, tracing.

Java Collections and Object Comparison Java Collection interface. Key classes. Collections class. Iteration options and the use of Iterator. Comparing primitives and objects. Operator overloading.

Error Handling Types of errors. Limitations of return values. Deferred error handling. Exceptions. Custom exceptions. Checked vs unchecked. Inappropriate use of exceptions. Assertions.

DesignLanguage evolution Need for languages to evolve. Generics in Java. Type erasure. Introduction to Java 8: Lambda functions, functions as values, method references, streams.

Design Patterns Introduction to design patterns. Open-closed principle. Examples of Singleton, Decorator, State, Composite, Strategy, Observer. [2 lectures]