Chapter 9 ITM 207 Final Exam Notes
Object-Oriented Design and High-Level Programming
A problem-solving methodology that produces a solution to a problem in
terms of self-contained entities called objects.
A thing or entity that makes sense within the context of the problem.
For example, a student, a car, time, date
Class (or object class)
A description of a group of similar objects
Classes contain fields that represent the
Properties (name, eye color) and
Behaviors (responsibilities) (shop, cook) of the class
Object (instance of a class)
A concrete example of the class
A named algorithm that defines behavior (shop, cook)
World View of OOD (Object-Oriented Design)
Problems are solved by:
- Isolating the objects in a problem,
- Determining their properties and actions (responsibilities) and
- Letting the objects collaborate to solve a problem
An analogy: You and your friend fix dinner.
Object: you, friend, dinner
Class: you and friend are people
People have name, eye color, …
People can shop, cook, …
Instance of a class: you and friend are instances of class
People, you have your own name and eye color, you each can
shop and cook.
You collaborate to fix dinner.
We call an object’s interactions with another object its responsibilities.
Responsibilities become methods in the Program World. Chapter 9 ITM 207 Final Exam Notes
Decomposes problems into tasks
Decomposes problems into collaborating objects
1. Isolate the real-world objects in the problem
2. Abstract the objects with like properties into groups (classes)
3. Determine the responsibilities of the group with other groups
Object-Oriented Design Methodology:
Four stages to the decomposition process:
- Brainstorming to locate possible classes
o A group problem-solving technique that involves the spontaneous
contribution of ideas from all members of the group.
All ideas are potential good ideas
Think fast and furiously first, and ponder later
A little humor can be a powerful force
o Brainstorming is designed to produce a list of candidate classes
- Filtering the classes to find duplicates or remove unnecessary ones
o Determine which are the core classes in the problem solution
o There may be two classes in the list that have common attributes
o There may be classes that really don’t belong in the problem
- Scenarios are tried to be sure we understand collaborations
o Assign responsibilities to each class
o There are two types of responsibilities
What a class must know about itself (knowledge
What a class must be able to do (behavior responsibilities)
The bundling of data and actions in such a way that the
logical properties of the data and actions are separated
from the implementation details.
Each class encapsulates its data but shares their values
through knowledge responsibilities. Chapter 9 ITM 207 Final Exam Notes
- Responsibility algorithms are designed for all actions that classes must
o The algorithms must be written for the responsibilities
Knowledge responsibilities usually just return the contents
of one of an object’s variables
Action responsibilities are a little more complicated, often
CRC Cards are a notational device to record information about a class, what it
must do and with whom it must collaborate.
A program written in a high-level language must be translated into machine
The machine code is then executed.
Compilers and Interpreters are software tools employed to help with the
A language that provides a richer (more English-like) set of instructions.
A program that translates a high-level language program into machine code.
A translating program that translates and executes the statements in
sequence. Chapter 9 ITM 207 Final Exam Notes
- Assembler or compiler machine code as output, which is then
executed in a separate step.
- An interpreter translates a statement then immediately executes
- Interpreters can be viewed as simulators.
- Introduced in 1996 and became instantly popular
- Portability was a primary importance
- Java is compiled into a standard machine language called Bytecode
- A software interpreter called the JVM (Java Virtual Machine) takes the
Bytecode program and executes it.
The ability of a program to be run on different machines
A program in a standardized language can be compiled and run on any
machine that has the appropriate compiler.