Quick Reference
From CSSEMediaWiki
(Difference between revisions)
Line 11: | Line 11: | ||
* [[Composite]] pattern and [[Avoid no-op overrides]] | * [[Composite]] pattern and [[Avoid no-op overrides]] | ||
* [[Eliminate irrelevant classes]] and [[No concrete base classes]] | * [[Eliminate irrelevant classes]] and [[No concrete base classes]] | ||
− | |||
=== Related Design Maxims === | === Related Design Maxims === | ||
* [[Dependency inversion principle]] and [[Program to the interface not the implementation]] | * [[Dependency inversion principle]] and [[Program to the interface not the implementation]] | ||
− | + | * [[Avoid side effects]] and [[Command query separation]] and [[Keep accessors and mutators separate]] | |
=== Design Pattern Cliff Notes === | === Design Pattern Cliff Notes === |
Revision as of 03:11, 4 October 2008
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
Related Design Maxims
- Dependency inversion principle and Program to the interface not the implementation
- Avoid side effects and Command query separation and Keep accessors and mutators separate
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).