Quick Reference
From CSSEMediaWiki
Revision as of 02:09, 29 September 2008 by RobertLechte (Talk | contribs)
Note:
- The intention of this guide is to be succinct. Don't use this for extended explanation, just note brief points. People can follow links for explanation.
- While this guide may be useful for the exam, don't be exam specific. This is a concise list of concepts to jog your memory, not a Cheat Sheet with direct answers from last year or whatever.
Contradictory Design Maxims
- Design by contract and Tell, don't ask
- Composite pattern and Avoid no-op overrides
- Eliminate irrelevant classes and No concrete base classes
Design Pattern Cliff Notes
- Decorator
- Identify by: Both HAS A and IS A at the same time, with multiple subclasses.
- Used for: Adding flexible combinations of specialized functionality.
- Classic Example: Adding scrolling functionality, borders, etc to a window.
- Why better than alternatives: Avoids combinatorial explosion of subclasses.
- Composite
- Identify by: Both HAS A and IS A at the same time, usually without subclasses.
- Used for: Making many act as one.
- Classic Example: Making a shape comprising other shapes.
- Why better than alternatives: Can use singular and collective instances totally transparently (identically).