CHAPTER 3: Best Practices in Java EE Web Development 157
The Service to Worker pattern, like the Dispatcher View pattern, consists of a combination of other
patterns from the catalog. Both of these microframework patterns describe the combination of a
controller and dispatcher with views and helpers, but the difference is that the Dispatcher View
pattern delays content retrieval until dynamic view generation, while the Service to Worker pattern
does content retrieval in the front controller.
We just covered all the Java EE web tier patterns. Using these patterns, you can address the
architectural domain problem and business problem areas. However, you must also use OO
patterns to address the architectural problem domain. Many design patterns can be applied to
attain reusability, maintainability and extensibility. For instance, you can attain this trinity in the web
application using OO patterns such as the following:
Abstract Factory
Builder
Decorator
Façade
Template Method
Client
Request
Delegate
Dispatch
Gather data
get Data
Front Controller Dispatcher View Helper View Helper
Figure 3-18. Service to Worker sequence diagram
Figure 3-18 illustrates the sequence diagram of the Service to Worker pattern.