Course outline (Object-Oriented Programming)
This lecture-by-lecture synopsis of the course is supplemented by links to handouts and problem sheets.
For convenience, all the typeset handouts are collected here in one document.
Abstract data types
 Programming with abstract data types. What do we mean by a 'large' program? A program for a simple editing task. Rewriting the program to use an abstract data type. Programming for change by separation of concerns. Handout.
 How to specify an ADT. Abstract state space. Operations with pre- and post-conditions, illustrated by the Text example and others. Invariants for a program that uses the Text ADT. Handout.
 How to implement an ADT. Concrete state space, concrete invariant, abstraction function. Implementing operations, illustrated by the Text example. Handout.
 Rules for specifying and implementing ADTs. Additional examples of data refinement. General formulation of the correctness criteria. Handout.
Designing with objects
This part of the course is organised around a programming case study: a text editor written in about 2,000 lines of Scala.
 Features of object-oriented programming. Encapsulation, object identity, polymorphism – but not inheritance. Handout.
 Command pattern. Handout.
 Model–View–Controller pattern. Handout.
 Implementing Undo. Handout.
 Subclasses and Inheritance. Handout.
 Fragile base class problem; implementing OO language features. Handout.
 Starting with Swing. (Based on Chapter 32 of Programming in Scala.)
 Designing AutoSnail. Building the GUI. Handout.
 Threads and Swing; painting; events. Handout, covering the last three lectures.
 Implementing Dijkstra's algorithm.
 Priority queues. Randomised testing against an abstract data type specification. Testing code.