Wednesday, February 14, 2007

OO Design Methodologies

(From GoF Design Patterns, Section 1.6 "How Design Patterns Solve Design Problems")

Object-oriented design methodologies differ in their approaches:
  1. Create classes and operations based on the nouns and verbs found in a written problem statement or specification.
  2. Focus on collaborations and responsibilities. Use CRC Cards (from Kent Beck) as a design aid.
  3. Translate real-world objects directly into object types and their behaviors into operations, known as the analysis model.
GoF says there will always be a disagreement on which approach is best, though the analysis model appears to be popular. However, the OO design still often ends up with classes that have no counterparts in the real world, so GoF warns:
Strict modeling of the real world leads to a system that reflects today's realities buyt not necessarily tomorrow's. The abstractions that emerge during design are key to making a design flexible. Design patterns help you identify less-obvious abstractions and the objects that can capture them.
For example: Design a chess system using object-oriented principles.

1 comment:

Anonymous said...

Largest Collection of Technical Interview Questions and Answers
Technical Interview Questions and Answers