[Tutor] techniques for OO design
Mon, 9 Oct 2000 10:58:27 +0100
> I'm wondering if any of you can suggest a method (pun
> intended) for thinking about how to structure an OO program.
The best book that I know of for starting out in OO is
Coad/Yourdon's Object Oriented Analysis. They present a
very clear and simple view of how to do OO and an eaqually
simple notation to go with it. The good news is the notation
is very similar to UML so the relearning is minimal.
The other things I find helpful are:
1/ Use "Responsibility Driven Design"
- think about what each object is responsible for.
2/ DO NOT THINK ABOUT DATA! OO Design should be driven by desired
behaviours, the data is there to support that behaviour.
3/ CRC cards are very useful
5x3 cards with a title line for the *C*lass name
and the rest split vertically. One side holds
the *R*esponsibilities and the other holds the
*C*ollaborators. - Hence CRC...
You can then play with these cards(or 'post-it's)
on a table/whiteboard until the shape of your system
> I understand that many people work with UML,
UML is a notation which originated with OO but can be used in almost any
software or systems design role. Its very useful for professional designs
but for small projects is probably overkill. You still need to understand
what you are doing with it too, like any notation it only captures the
output of your design not how you got there!