Object-Oriented Design
Identifying Objects (and Classes)
Identify the
nouns
(objects) in the problem description.
Identify more objects in your developing problem solution.
(Design is incremental and iterative! -- Grady Booch)
From these objects, determine what new types (classes) you need.
Example: BlackJack Program
cards
a deck
a dealer
player(s)
Sample Design Questions:
Do different cards represent different types? Or are suit and rank
attributes
of a single card type?
Are the dealer and player instances of the same class?
I.e.
, objects of the same type?
Should there be a separate Hand class?
Identifying Objects
|
Identifying Operations
|
Identifying Relationships
|
Developing Scenarios
Implementation
|
Summary
|
Books
Example: Graphical Notation
Example: CRC Notation