CS:2820 Object-Oriented Software Development
Spring 2015


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
Jan 20

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]
Jan 22

Decomposition of Complex systems. The role of design in software development
A few notes on

  • compiled vs. interpreted languages
  • Java and languages based on the Java Virtual Machine
  • statically-typed vs. dynamically-typed languages.
Introduction to Scala. The Scala interpreter. First examples of Scala expressions.

- Class notes 1 [pdf]
- Intro notes on Scala [pdf]
- Ch. 1 of [S]
Jan 27

First step in Scala. Basic types and implicit conversions. Tuple types. Mutable and immutable variables. Expressions with side effect. Control structures: if expressions and and sequential composition. Blocks. Methods. Unit returning methods.

- Ch. 2 of [S]
- Scala examples 1
Jan 29

More on Scala's main constructs. Control structures: while. Recursive methods. Nesting and variable scoping. Patterns and pattern matching. Immutable lists. List construction and pattern matching over lists.

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

- Homework 1 out (on ICON)
Feb 3

Arrays in Scala. More Scala control structures: for. Iterating over collections.

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

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

The Object Model of development. Examples of abstraction, encapsulation and contracts. Classes and class hierarchies. Subclassing and inheritance. Single and multiple inheritance.

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 [pdf]
- Ch. 4 of [S]
- Scala examples 5

- Homework 1 due
  (on Friday, on ICON)
Feb 10

Designing class hierarchies in OO programming languages. Subclassing and inheritance. Abstract and concrete classes. Factorization of methods and fields in superclasses. Examples in Scala.

- Ch. 6,10 of [S]
- Scala examples 6
Feb 12

Overriding of fields and methods in subclasses. Static vs. dynamic type of an object. Composition vs. inheritance. 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]
- Scala examples 7

- Homework 2 out on Friday
Feb 17

Discussion of Homework 2 and parallels with Vector example studied in the lab.
Notes on the Scala Option type.
Parametric polymorphism as a complementary way to promote reuse. Generic methods and classes in Scala. Motivations and examples.

- Ch. 19.1 of [S]
- Scala examples 8
- Scala examples 9
Feb 19

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
Feb 24

More on higher-order programming in Scala. Examples.
Runtime assertions in Scala. Using assertions 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 10 (revised)
- Scala examples 11
Feb 26

More on contracts and their use. 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

- Homework 3 out on Friday
Mar 3

Discussion of Homework 2 grades and solution.
Using ScalaCheck for Scala unit testing. Expressing method specifications as ScalaCheck properties. Examples and exercises.

- ScalaCheck package
- ScalaCheck user guide
- Scala examples 12
Mar 5

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
Mar 10

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

- Ch. 4, 13, 29 of [S]
- Scala examples 14
  (see also here)
- demo program
Mar 12 Midterm See Exams section  
Mar 17

Spring break

Mar 19

Spring break

Mar 24

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]
Mar 26

Concurrent programming. The actor model.
Actors in Scala. Examples.
(Check the Akka actors documentation as needed for more information.)

- Notes by A. Manivannan [web]
- Notes by D. Westheide [web]
- Scala examples 15
Mar 31

Iterative development and its benefits. Pitfalls of the waterfall life cycle. The Unified Process and its main phases.
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]  
Apr 2

Requirements and requirement elicitation. 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. Example. Granularity tests.
How to work with use cases. Exercise: "Get drink" use case on vending machine application.

- Ch. 6 of [T]
- Class notes on Ch. 5-6 [pdf]
Apr 7

Transitioning from the Inception to the Elaboration stage in the UP. Overview of the Elaboration stage. Planing the iterations.
Domain modeling using UML class diagrams. Domain objects (concepts) versus software objects.

- Ch. 8 of [T]
- Class notes on Ch. 8 [pdf]
Apr 9

Domain models continued. Drawing the DM as simplified class diagrams. Proper identification and style of concepts, attributes and associations.
Introduction to System Sequence Diagrams. Translating use cases to SSDs.

- Ch. 9, 10 of [T]
- Class notes on Ch. 9 [pdf]
- Class notes on Ch. 10 [pdf]
Apr 14 Further defining the objects' behavior through Operation Contracts. Emphasis on postconditions. Transitioning from system modeling to design. Layered architectures and the Domain Layer. - Ch. 11-14 of [T]
- Class notes on Ch. 11 [pdf]
- Class notes on Ch. 12-14 [pdf]
Apr 16 Defining the objects: CRC cards and dynamic modeling. Introduction to UML interaction diagrams: sequence diagrams and communication diagrams. - Ch. 14, 15 of [T]
- Class notes on Ch. 15 [pdf]
- Sequence diagrams tutorial
Apr 21 Static object modeling. Design class diagrams. Group exercise on modeling an email client. - Ch. 16 of [T]
Apr 23 Group exercise: class diagram design for mail client application. Focus on subclass hierarchy, attributes and associations. Discussion. - Ch. 16 of [T]
Apr 28

Group exercise: sequence diagram design for mail client application. Using sequence diagrams to inform refinement of class diagrams with methods. Discussion.

Apr 30

The GRASP design methodology. Responsibilities-driven design and design patterns. Basic design patterns and motivation. Examples of object-oriented design with GRASP.

- Class notes on Ch. 15 [pdf]
- Ch. 17, 18 of [T]
May 5

Question and answer session on the course project.

May 7

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

- Leon website (recommended)
May 15 Final Exam See Exams section  

Copyright: Cesare Tinelli, The University of Iowa, 2015