ITM 207 Chapter Notes - Chapter Final: Prolog, Data Type, Brainstorming

62 views8 pages
Published on 17 Apr 2013
School
Ryerson University
Department
Information Technology Management
Course
ITM 207
Professor
Chapter 9 ITM 207 Final Exam Notes
Object-Oriented Design and High-Level Programming
Chapter 9
Object-Oriented Design:
A problem-solving methodology that produces a solution to a problem in
terms of self-contained entities called objects.
Object
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
Method
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.
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 8 pages and 3 million more documents.

Already have an account? Log in
Chapter 9 ITM 207 Final Exam Notes
Top-Down Design
Decomposes problems into tasks
Object-Oriented Design
Decomposes problems into collaborating objects
Steps:
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
and behaviors
o There may be classes that really don’t belong in the problem
solution
- 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
responsibilities)
What a class must be able to do (behavior responsibilities)
o Encapsulation
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.
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 8 pages and 3 million more documents.

Already have an account? Log in
Chapter 9 ITM 207 Final Exam Notes
- Responsibility algorithms are designed for all actions that classes must
exhibit
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
involving calculations.
CRC Cards:
CRC Cards are a notational device to record information about a class, what it
must do and with whom it must collaborate.
Translation Process:
A program written in a high-level language must be translated into machine
code.
The machine code is then executed.
Compilers and Interpreters are software tools employed to help with the
translation process.
Compilers:
High-level language
A language that provides a richer (more English-like) set of instructions.
Compiler
A program that translates a high-level language program into machine code.
Interpreters:
A translating program that translates and executes the statements in
sequence.
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 8 pages and 3 million more documents.

Already have an account? Log in

Get OneClass Grade+

Unlimited access to all notes and study guides.

YearlyMost Popular
75% OFF
$9.98/m
Monthly
$39.98/m
Single doc
$39.98

or

You will be charged $119.76 upfront and auto renewed at the end of each cycle. You may cancel anytime under Payment Settings. For more information, see our Terms and Privacy.
Payments are encrypted using 256-bit SSL. Powered by Stripe.