|Service to Worker Pattern
- A Web based system that generates presentation
content(view) based on a
template and a dynamic model.
- The system controls flow of execution and access to
business data, from which it
creates presentation content.
- Problem is the combination of the problems solved by
the Front Controller and View
- The system does not have a centralized request
handling mechanism for managing the
application services for each request.
- Business and formatting logic is embedded directly
view. This makes the system less flexible, less reusable and less
resilient to change.
- Mixing the business and system logic with
the view reduces modularity and provides a poor separation of roles
among team members.
- Authentication and authorization checks are completed
- Scriptlet code within views should be minimized
- Business logic should be encapsulated in components
other than the view
- Control flow is relatively complex and based on
values from dynamic content
- Multiple views are commonly used for responding to
the similar business
- Combine the Front Controller and View Helper patterns
to move some presentation logic
forward into the controller and application logic back into Helpers.
- A Front Controller is the initial point of contact
for the request and is responsible for
managing many aspects of request handling
- System services such as authentication and
- Delegation of business processing, choosing an
appropriate view, selection of content-creation strategies.
- Preparing the model for use by the view , which it
- Object requesting the generation of the view
- Initial point of contact for handling a request
- Responsible for view management and navigation
- Manages the choice of the next view to be presented
to the user
- Can be encapsulated within the controller
- Represents and displays information to the client
- Responsible for helping a view or controller
complete its processing.
- Responsible for gathering data required by view and
storing this intermediate model.
- Another name for the helper
- Responsible for holding intermediate model state
for use by a view.
- Business Service
- Role that is fulfilled by the service the client is
seeking to access.
- Accessed via a business delegate
- Servlet Front Strategy
- The Front Controller is implemented as a servlet.
- This is the preferred to the JSP Front Strategy.
- JSP Front Strategy
- The Front Controller is implemented as a JSP Page
- JSP View Strategy
- The view component is implemented as a JSP page
- Servlet View Strategy
- The view component is implemented as a Servlet
- JavaBean Helper Strategy
- Helper is implemented as a JavaBean
- JavaBeans are easily constructed and integrated
into a JSP environment
- Custom Tag Helper Strategy
- The Helper is implemented as a custom tag (JSP 1.1
- Centralized control
- Improves Modularity and Reuse
- Improves Application Partitioning
- Improves Role Separation
- Front Controller and View Helper
- The Service to Worker pattern is the result of
combining the View Helper pattern
with a dispatcher, in coordination with the Front Controller pattern.
- Dispatcher View
- Another name for the combination of the Front
Controller pattern with a dispatcher,
and the View Helper pattern.