Java Reference
In-Depth Information
Take care when deciding to implement the façade as a stateful session bean to ensure that it will not
cause resource consumption issues.
A well‐designed application makes good use of the façade pattern to encapsulate complicated logic
and decouple subsystems from clients; however, the premature and overuse of the façade pattern can
lead to a more complicated system with multiple layers.
The session façade pattern is akin to the boundary in the entity‐control‐boundary architectural
pattern, and it is related to the adapter and wrapper patterns.
EXERCISES
1. List some public API implementations of the façade pattern and explain how they hide the
complicated logic of the subsystem.
2. Develop a façade that hides the complicated logic of an order and payment system.
3. Encapsulate method invocations to the two subsystems—payment and order—in just two
methods.
4. Develop the façade as a singleton.
NOTES
1. Design Patterns: Elements of Reusable Object‐Oriented Software (Addison‐Wesley, 1994):
Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides.
2. Head First Design Patterns (O'Reilly, 2004): Eric Freeman, Elisabeth Robson, Bert Bates,
Kathy Sierra.
 
Search WWH ::




Custom Search