22c:022 Object-Oriented Software Development
Fall 2013


This page summarizes the content of past lectures and provides lecture notes and exercises.

Note: In the readings below, "[T]" refers to the textbook and "[S]" to the recommended Scala book.

(Jump to most recent class)

Date Topic Readings
Aug 27

Course introduction and syllabus overview.

The complexity of software systems. The challenges of software development. Features of good software systems.

- Syllabus
- Class notes 1 [pdf]
- Ch. 1 of [S]
Aug 29

Decomposition of Complex systems. The role of design in software development

Introduction to Scala. The Scala interpreter. First examples of Scala expressions. Basic types and implicit conversions. Tuple types.

- Ch. 1, 2 of [S]
- Intro notes on Scala [pdf]
- Scala examples 1
Sep 3

More on Scala. Mutable and immutable variables. Expressions with side effect. Sequential composition. Blocks. Control structures: if and while. Methods. Unit returning methods. Recursive methods. Nesting and variable scoping. Patterns and pattern matching.

- Ch. 2 of [S]
- Scala examples 2
Sep 5

More on pattern matching in Scala. Immutable lists. List construction and pattern matching. Recursive functions over lists.

- Ch. 3 of [S]
- Scala examples 3

- Homework 1 out (on ICON)
Sep 10

The Object Model of development. Origins and evolution. Major features: abstraction and encapsulation. Design by contract. Examples of abstraction, encapsulation and contracts.

More Scala control structures: for. Iterating over collections.

- Class notes 2 [pdf]
- Ch. 7 of [S]
- Scala examples 4
Sep 12

The Object Model of development. Classes and class hierarchies. Subclassing and inheritance. Single and multiple inheritance. Types and type systems.

Classes and objects in Scala. Class declarations and initialization. Fields and methods. Parameterless methods. Encapsulation and information hiding in OO languages. Separating the interface from implementation. Examples in Scala.

- Class notes 2
- Ch. 4 of [S]
- Scala examples 5

- Homework 1 due (on ICON)
Sep 17

Designing class hierarchies in OO programming languages. Subclassing and inheritance. Abstract and concrete classes. Factorization of methods and fields in superclasses. Overriding of fields and methods in subclasses. Static vs. dynamic type of an object. Composition vs. inheritance. Examples in Scala.

- Ch. 6,10 of [S]
- Scala examples 6
- Scala examples 7
Sep 19

Abstract fields and methods. Motivation and uses.
Defining features of objects: identity, state and behavior. Classes as contracts. Contract inheritance. Behavioral subtyping and the substitution principle. Examples in Scala.

- Class notes 3 [pdf]

- Homework 2 out
Sep 24

Discussion of Homework 1 grades. Note on the Scala Option type (to be used in Homework 2).

More on the substitution principle. Pitfalls with the is-a relation when modeling mutable objects. Examples with mutable rectangle and square classes.
Parametric polymorphism as a complementary way to promote reuse. Generic methods and classes in Scala. Motivations and examples.

- Ch. 19.1-2 of [S]
- Scala examples 9
Sep 26

More on generic classes in Scala. Examples.
Functions and closures in Scala. Functions as values. Programming with higher-order methods. Capturing computational patterns with higher-order methods. Examples.

- Ch. 8 of [S]
- Scala examples 9
- Ch. 16 of [S], as needed
- Scala examples 10

- Homework 2 due
Oct 1

Runtime assertions in Scala. Using assertion to in support of the Design-by-contract methodology. the require, assert and ensures constructs. Examples and exercises. Pros and cons.

- Sec. 14.1-14.3 of [S]
- Scala examples 11

- Homework 3 out
Oct 3

Discussion of Homework 2 grades.

More practice with specifying contracts with require, assert and ensure. Sorted queue example.
Introduction to property-based testing with scalacheck. Motivation and advantages of property-based testing.

- Scala examples 11
Oct 8

Using Scalacheck for Scala unit testing. Expressing method specifications as scalacheck properties. Examples and exercises.

- scalacheck package
- scalacheck user guide
- Scala examples 12

- Homework 3 due
Oct 10

Single vs. multiple inheritance. OO modeling exercise: the animal domain. Achieving multiple inheritance in OO languages. Scala traits. Uses and examples.

- Ch. 12 of [S]
- Scala examples 13
Oct 15


See Exams section  
Oct 17

Modules and modularity. Module decomposition vs class decomposition.
Modularity in Scala: singleton classes (objects) and packages. Uses and examples.

- Ch. 13, 29 of [S]
- Scala examples 14
  (see also here)
- demo program
Oct 22

Discussion of midterm grading and solutions.
Analysis and design in software development. Iterative and evolutionary approaches. The Unified Process. Unified Modeling Language.

- Ch. 1, 2 of [T]
- Class notes on Ch. 1 [pdf]

- Homework 4 out
Oct 24

The benefits of iterative development. Pitfalls of the waterfall life cycle. Main phases of the UP.
Introduction to two main cases studies: POS systems and Monopoly game.
The inception phase of the Unified Process. Main goals and artifacts.

- Ch. 2, 3, 4 of [T]
- Class notes on Ch. 2 [pdf]
- Class notes on Ch. 4 [pdf]  
Oct 29

Requirements and requirement elicitation. The evolutionary nature of requirements. Main types of requirements and related artifacts. Use cases. Actors and scenarios. Types of actors. Levels of detail in use cases. Main and alternative scenarios. Examples.

- Ch. 6 of [T]
- Class notes on Ch. 5-6 [pdf]
Oct 31

More on use cases. Guidelines for writing good use cases. Examples. Granularity tests.
How to work with use cases. Exercise: "Get drink" use case on vending machine application.

- Ch. 6 of [T]
Nov 5

Domain modeling using UML class diagrams. Associations vs. attributes. Examples. Cardinality constraints in associations. Special associations: generalization and aggregation. Examples.
Modeling exercise.

- Ch. 8, 9 of [T]
Nov 7

More on class diagrams. Examples.
Introduction of the class project. Brief discussion of the Model View Controller pattern and f the Elevator Algorithm.

- Ch. 9 of [T]
Nov 12 System sequence diagrams. Motivation and examples. Group exercise.
Operation contracts as a complement and extension to use cases. Preconditions and postconditions. Examples.
- Ch. 10, 11 of [T]
Nov 14 Objected Oriented Design. UML Interaction Diagrams. Sequence diagrams. Examples and group exercise. - Ch. 14, 15 of [T]
- Sequence diagrams tutorial
Nov 19 Follow-up group exercise on sequence diagrams.
Design class diagrams. Uses and examples.
- Ch. 16 of [T]
Nov 21 The GRASP design methodology. Assigning responsibilities to software classes. Design patterns. Basic patterns and motivation. - Ch. 17 of [T]
Nov 26

Thanksgiving break

Nov 28

Thanksgiving break

Dec 3

Examples of object-oriented design with GRASP. Use case realizations for POS system.

- Ch. 18 of [T]
Dec 5

Concurrent programming. The actor model.
Actors in Scala. Examples.

- Ch. 32 of [S]
- Class notes by T. Dsilva [pdf]
- Scala examples 15
Dec 10

Verifying the correctness of Scala program with the Leon verifier.
Brief overview of Leon. Specification and verification examples.

- Leon website (recommended)
Dec 12

Question and answers session on the course project.


Copyright: Cesare Tinelli, The University of Iowa, 2013