San Jose State University : Site Name


Main Content

Working in Mars Mission Control, JPL

Ronald Mak

Department of Computer Engineering
Department of Computer Science
Department of Applied Data Science
Spring Semester 2020

Office hours: TuTh: 4:30-5:30 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 30 Feb 7 Functional Specification

Use case form: UseCaseForm.docx
Formal report rubrics: FormalReportRubrics.pdf
2 Feb 11 Feb 21 Design Specification
3 Feb 20 Feb 28 Command-Line Rock-Paper-Scissors Game
4 Feb 27 Mar 13 RPS Game with Simple Machine Learning
5 Mar 17 Apr 6 GUI-Based RPS Game

Student's tutorial: How to install on Windows
6 Apr 14 Apr 24 Design Patterns


Week Date Content
1 Jan 23 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

Example programs:  
2 Jan 28 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 30 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 4 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 6 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 11 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 13 Slides: Textual analysis; CRC cards; UML class diagrams: dependency, association, examples; UML state diagram; proposed C++ Date class; code to the interface; static factory function
5 Feb 18 Slides: Day class implementations; importance of encapsulation; principles; accessors and mutators; dangerous setter; no surprises; immutable classes; sharing references to

Example programs:
Feb 20 Slides: Immutable objects; sharing references to mutable objects; const fields; separate accessors and mutators; side effects; Law of Demeter; how good is an interface?; cohesion; completeness; convenience; clarity; consistency; Assignment #3
6 Feb 25 Slides: Programming by contract; 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;

Example program: AssertExample.cpp
Feb 27 Slides: Interface variables; objects and interfaces; 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 3 Slides: SimUDuck simulation game; code reuse; delegation; abstract superclass; "has a" often better than "is a"; virtual destructors

Example programs:
Oct 3 Slides: Overloading vs. overriding; operator overloading midterm review; requirements meeting video

Requirements video
8 Mar 12 Video recording
Slides: Model-View-Controller (MVC) architecture; events; event handlers; callback functions; inversion of control; wxWidgets; hello world example; buttons demo;

Example wxWidgets programs: wxHelloWorld.cpp
9 Mar 17 Video recording
Slides: Midterm solutions; wxWidgets installation on MacOS X; create wxWidgets apps in Eclipse; button demo; Assignment #5

Example wxWidgets programs:
Mar 19 Video recording
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

Example program:
10 Mar 24 Video recording
Slides: Starbuzz Coffee example; initial design; second design; open-closed principle; the Decorator Pattern; UML; Starbuzz design, implementation, and test; Decorator Pattern caveats

Example program:
Mar 26 Video recording
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

Example program:
11 Apr 7 Video recording
Slides: Adapter Design Pattern; turkey adapter example; Facade Design Pattern; home theater example; principle of least knowledge
Apr 9 Video recording
Slides: wxWdgets sample menu program; State Design Pattern

State Design Pattern example programs:
12 Apr 14 Video recording Password v5+4@?DA
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 16 Video recording Password x3#=p7=o
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 21 Video recording Password 2j^$X+#5
Slides: A "safe" array type; overloaded assignment operator; overloaded subscript operator []; copy constructor; the "Big Three"; auto; decltype; exception

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
Exception handling examples: exception1.cpp   exception2.cpp   exception3.cpp
Apr 23 Video recording Password 2Z$4008A
Slides: Exception handling; function objects; Standard Template Library (STL); iterators; containers; STL list; STL map; STL algorithms

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 28 Video recording Password 1t.E1U#^
Slides: Pointers vs. references; use of references; raw pointers vs. smart pointers; unique pointer; shared pointer; move semantics

Example programs:
Apr 30 Video recording Password 7D!#!+Xx
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 5 Video recording 7A#0NF=e
Presentations: Rock Paper Scissors, Four-head, Oops
May 7 Slides
Presentations: Technical Difficulties, Trash Panda


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.

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.

Course Learning Outcomes (CLO)

Department policy is to enforce
all course prerequisites strictly


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

Recommended books

The following is the original “Gang of Four” design patterns book. The examples are in C++.
Design Patterns: Elements of Reusable Object-Oriented Software
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides
Addison-Wesley Professional, 1994

The following book provides optional background material. The examples are in Java.
Object-Oriented Analysis, Design and Implementation: An Integrated Approach, 2nd edition
Brahma Dathan and Sarnath Ramnath
Springer, 2015