Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Sp00 Final Exam Review: Design Patterns
See Final Exam Review - Sp2000
They are similar in that they both provide the Factory Method. You abstractly provide some interface for creating an object, but the actual semantics you leave to the subclasses to implement. This allows you to not hardcode any sort of a specific class creation. You
simple say "self giveMeWhatIWant", and the subclasses take care of the actual details. Both DP's provide a great way of hiding the gory details of actual implementation. It can allow you to focus on the solution, rather than the nitty-gritty detail of implementation.
They are different in that the Abstract Factory provides one more level of abstraction. With the Factory Method, you leave it to the ConcreteCreator subclasses to give the ConcreteProduct that was needed. But, with Abstract Factory method, you are asking for the Factory itself.
Factory Method: the factory method returns the ConcreteProduct needed
Abstract Factory Method: the abstract factory method returns the factory needed that
returns the ConcreteProduct needed
Bridge vs. Adapter Differences:
- Adapter provides an implementation abstraction over and existing legacy system to provide functions that would otherwise be too difficult to add to the existing sytem, or impossible due to lack of source code, documentation, etc...
- Bridge allows the interface to use some common component to be de-coupled from the actual implementation of that component
Bridge vs. Adapter Similarities:
- Both provide an interface above actual code and implementation to ease development and allow the nitty-grittiness of raw code to be hidden.
- Both are essentially a wrapper that provide an interface to the actual hidden implementation.
Link to this Page