Facade
From CSSEMediaWiki
(Difference between revisions)
(something > nothing) |
(more descriptions and an example) |
||
Line 1: | Line 1: | ||
− | The facade pattern is used to provide a simple interface to a complex set of interfaces. Often facades are produced to further simplify common APIs or adapt them to a more specific use. | + | The facade pattern is used to provide a simple interface to a complex set of interfaces. Often facades are produced to further simplify common APIs or adapt them to a more specific use. |
+ | |||
+ | The design pattern | ||
+ | * provides convenient methods | ||
+ | * makes the inner system more flexible since less methods are called from the outside | ||
+ | * can turn a badly designed API into a very well usable one | ||
+ | |||
+ | == Example == | ||
+ | The boot process of a computer can be modeled as a Facade. The system's boot() method is called. This method now starts and configures all the services and programs needed to use the computer. | ||
[[Category:Design Patterns]] | [[Category:Design Patterns]] |
Revision as of 06:13, 23 July 2009
The facade pattern is used to provide a simple interface to a complex set of interfaces. Often facades are produced to further simplify common APIs or adapt them to a more specific use.
The design pattern
- provides convenient methods
- makes the inner system more flexible since less methods are called from the outside
- can turn a badly designed API into a very well usable one
Example
The boot process of a computer can be modeled as a Facade. The system's boot() method is called. This method now starts and configures all the services and programs needed to use the computer.
Design patterns | |
---|---|
Creational: Abstract Factory | Builder | Factory Method | Prototype | Singleton |