San Jose State University : Site Name


Main Content

Working in Mars Mission Control, JPL

Ronald Mak

Department of Computer Engineering
Spring Semester 2019

Office hours: TuTh: 3:00-4:00 PM
Office location: ENG 250
Mission Control, Jet Propulsion Laboratory (JPL)
NASA Mars Exploration Rover Mission

CMPE/SE 135 Object-Oriented Analysis and Design

Section 1:  TuTh  1:30 - 2:45 PM  room ENG 337


# Assigned Due Assignment
1 Jan 31 Feb 8 Functional Specification

Use case form: UseCaseForm.docx
Formal report rubrics: FormalReportRubrics.pdf
2 Feb 12 Feb 22 Design Specification
3 Feb 21 Mar 1 Command-Line Rock-Paper-Scissors Game
4 Feb 28 Mar 11 RPS Game with Simple Machine Learning
5 Mar 19 Apr 8 GUI-Based RPS Game
6 Apr 16 May 3 Design Patterns


Week Date Content
1 Jan 24 Slides: Course objectives; project teams; postmortem report; grading; good applications; change and complexity; how to achieve good design; iterative process; poor design not a failure; Rick's Guitars; problems
2 Jan 29 Slides: Continued iterations: (#2) remove string fields and return multiple matches, (#3) encapsulate what changes, (#4) new characteristics, (#5) refactored code, delegate the matching task

Example programs:
Jan 31 Slides: Summary; cohesion; loose coupling; OOA&D is about satisfaction; requirements elicitation; functional and nonfunctional; requirements of requirements; how to get requirements; use cases; use case descriptions; Functional Specification; Assignment #1
3 Feb 5 Slides: Key points for good design; iterative development; solutions to adding a new mandolin instrument; Instrument and InstrumentSpec classes; abstract classes; revised Inventory class; Guitar, GuitarSpec, Mandolin, MandolinSpec classes; red flags; more instruments; design doesn't scale well; encapsulation to the rescue?

Example programs:
Feb 7 Slides: Revisit our design; encapsulate with a hash map; use the Boost C++ library; boost::any; new attribute classes; the improved design; conclusions

Example programs:   Boost C++ library
Install the Boost header files (no need to build the libraries). In each project, tell Eclipse (or use the -I option on the command line) where you installed them.
4 Feb 12 Slides: Complexity; decomposition: algorithmic and object-oriented; hierarchy; design in software engineering; analysis precedes design; paralysis by analysis; where do classes come from; categories of classes; class responsibilities; class relationships: dependency, aggregation, inheritance; UML diagrams; class diagrams; sequence diagram; Assignment #2
Feb 14 Slides: Textual analysis; CRC cards; UML class diagrams: dependency, association, examples; UML state diagram; proposed C++ Date class; code to the interface; factory method design pattern; Day class design
5 Feb 19 Slides: Day class implementations; importance of encapsulation; principles; accessors and mutators; dangerous setter; no surprises; immutable classes; sharing references to immutable objects; const fields; separate accessors and mutators

Example programs:
Feb 21 Slides: Side effects; Law of Demeter; how good is an interface?; cohesion; completeness; convenience; clarity; consistency; Assignment #3; programming by contract; preconditions; circular queue example
6 Feb 26 Slides: Preconditions; circular queue example; assertions; exceptions; postconditions; class invariants; proof of a class invariant; interface invariant vs. implementation invariant; interfaces; RPG game; code to the interface; factory class; interface variables; objects and interfaces

Example program: AssertExample.cpp
Feb 28 Slides: Simple machine learning for RPS; Assignment #4; inheritance; superclasses and subclasses; class hierarchies; Liskov Substitution Principle; overridden member functions; polymorphism; invoke a superclass member function; invoke a superclass constructor; invoke a constructor from another; preconditions and inheritance; postconditions and inheritance; more inheritance conditions; examples: point-circle-rectangle, vector-stack

Example programs:   PointCircleRectangle.cpp   VectorStack.cpp
7 Mar 5 Slides: Fixed vector-stack; SimUDuck simulation game; code reuse; delegation; abstract superclass; "has a" better than "is a"; virtual destructors

Example programs:
Mar 7 Slides: Overloading vs. overriding; midterm review; requirements video
8 Mar 14 Slides: Model-View-Controller (MVC) architecture; events; event handlers; callback functions; inversion of control; wxWidgets; hello world example; buttons demo;
9 Mar 19 Slides: Midterm solutions; wxWidgets installation on MacOS X; create wxWidgets apps in Eclipse; button demo; Assignment #5

Example wxWidgets programs: wxHelloWorld.cpp    MakefileButtonsDemo
Mar 21 Slides: Review: object-oriented design basics and principles; design patterns; shared pattern vocabulary; how to use design patterns; the Strategy Pattern; weather monitoring station example; subscriptions; Observer Pattern defined; observer pattern UML; loose coupling; weather station design and implementation; display elements implementation; Observer Pattern summary
10 Mar 26 Slides: Starbuzz Coffee example; initial design; second design; open-closed principle; the Decorator Pattern; UML; Starbuzz design, implementation, and test; Decorator Pattern caveats
Mar 28 Slides: new => concrete; Pizza shop example; simple pizza factory; pizza store framework; PizzaStore subclasses; factory method; abstract and concrete Pizza classes; Factory Method Design Pattern
11 Apr 9 Slides: Adapter Design Pattern; turkey adapter example; Facade Design Pattern; home theater example; principle of least knowledge
Apr 11 Slides: State Design Pattern; button and menu event handlers; wxWidgets sample programs
12 Apr 16 Slides: Iterating over a container; Iterator Design Pattern; common iterator API; iterator example; part-whole hierarchy; tree component; subtree component; composite example; Composite Design Pattern; Assignment #6

Example programs:
Apr 18 Slides: Lambda expressions; arrays of objects; constructors and destructors; vectors of objects; copy constructor; "extra" constructor and destructor calls; how a vector grows; dynamic arrays of objects; mysterious program crash; shallow copy; deep copy

Example programs:
13 Apr 23 Slides: A "safe" array type; overloaded assignment operator; overloaded subscript operator []; copy constructor; the "Big Three"

SafeArray example 1: (crashes) SafeArray1.h   SafeArray2.cpp   SafeArrayTests1.cpp
SafeArray example 2 (operator =): SafeArray2.h   SafeArray2.cpp   SafeArrayTests2.cpp
SafeArray example 3 (fix operator =): SafeArray3.h   SafeArray3.cpp   SafeArrayTests3.cpp
SafeArray example 4 (another fix operator =): SafeArray4.h   SafeArray4.cpp   SafeArrayTests4.cpp
SafeArray example 5 (overload []): SafeArray5.h   SafeArray5.cpp   SafeArrayTests5.cpp
SafeArray example 6 (copy constructor): SafeArray6.h   SafeArray6.cpp   SafeArrayTests6.cpp
Apr 25 Slides: Exception handling; function objects; Standard Template Library (STL); iterators; containers; STL list; STL map; STL algorithms

Exception handling examples: exception1.cpp   exception2.cpp   exception3.cpp
Function object examples: RandomInt.h    RandomIntTester.cpp    Summation.h    SummationTester.cpp
Vector iterator examples: IteratorVector1.cpp   IteratorVector2.cpp
STL list example: ListTest.cpp
STL map example:
STL algorithms example: AlgorithmsTest.cpp
14 Apr 30 Slides: Auto keyword; decltype pseudo-function; raw pointers vs. smart pointers; unique pointer; shared pointer; move semantics; presentation schedule

Example programs:
May 2 Slides: Multithreaded programming; concurrency vs. parallelism; race condition; critical regions and shared resources; mutual exclusion; mutexes; sleep and wakeup; semaphores; Pthreads package

Example multithreaded program: officehour-mac.cpp
15 May 7 Slides:
Presentations: Emojis, JARS, Dagoon Icy, Say Agile One More Time
May 9 Slides:
Presentations: Extras, Benedict+3, No Name 1; review for the final exam


Become familiar with object-oriented analysis and program design. Employ industry-standard practices of an object-oriented approach to software development. Avoid the pitfalls of object-oriented design.

The primary goal of this course is to become a much better programmer.

The instructor will share decades of experience as a successful software developer in industry, government, and scientific research institutions. The programming examples will be mostly in C++, but the material will apply well to other object-oriented languages such as Java.

You will follow industry-standard best practices and use software development tools that are common in today’s software industry.

You will develop the critical job skill of working in a small project team to successfully develop a software application that uses shared interfaces and data formats. Your application can then interact with applications from other teams to exchange data and results.

Department policy is to enforce
all course prerequisites strictly


For SE Majors: CS 046B
For others: CMPE 126

Required books

There is no required textbook. You will receive reading material during the semester.