Course outline (Object-Oriented Programming)

From Spivey's Corner
Jump to: navigation, search

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

[1] 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.

[2] 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.

[3] How to implement an ADT. Concrete state space, concrete invariant, abstraction function. Implementing operations, illustrated by the Text example. Handout.

[4] 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.

[5] Features of object-oriented programming. Encapsulation, object identity, polymorphism – but not inheritance. Handout.

[6] Command pattern. Handout.

[7] Model–View–Controller pattern. Handout.

[8] Implementing Undo. Handout.

[9] Subclasses and Inheritance. Handout.

[10] Fragile base class problem; implementing OO language features. Handout.

  • Listing of the Ewoks editor: plain for on-screen viewing, two-up for printing.

GUI programming

[11] Starting with Swing. (Based on Chapter 32 of Programming in Scala.)

[12] Designing AutoSnail. Building the GUI. Handout.

[13] Threads and Swing; painting; events. Handout, covering the last three lectures.

[14] Implementing Dijkstra's algorithm.

[15] Priority queues. Randomised testing against an abstract data type specification. Testing code.

  • Listing of AutoSnail: plain for on-screen viewing, two-up for printing.