J2EE Design Pattern : Presentation Tier Patterns : Service to worker Design Pattern
| Service to worker Design Pattern? |
Service to worker combines a Dispatcher component with the Front Controller and View Helper Patterns.
Problem
- How sophisticated is the control logic?
- How dynamic is the response content?
- How sophisticated is the business logic and model?
Context
Business and the data services are invoked before the view is rendered. For any particular request, then by seeing problems which can occur. we have to see how much work needs to be done during the view preparation phase of request processing.
Solution
Use Service to Worker to centralize control and request handling to retrieve a presentation model before turning control over to the view. The view generates a dynamic response based on the presentation model.
Service to Worker is composed of several other patterns. Centralized control, request handling, and view creation are accomplished using Front Controller, Application Controller, and View Helper respectively.
Non-software Service to worker Example

Service to worker Class Diagram

Participants and Responsibilities
FrontController
A FrontController initially handles a request, delegating to an application controller for action and view management.
ApplicationController
An ApplicationController is responsible for action and view management. It manages choosing the appropriate action and view to fulfill a request. For simple cases, this behavior can be folded into a Front Controller, using a Dispatcher in Controller strategy.
View
A View represents and displays information to the client. The presentation model is adapted for display by View Helper. View can be a Composite View.
BusinessHelper, ViewHelper
A helper is responsible for helping a view or controller perform specific processing. A BusinessHelper helps a controller initiate business processing to handle a request, while a ViewHelper retrieves and adapts aspects of a PresentationModel to help generate a View.
PresentationModel
The PresentationModel holds the data retrieved from the business service, used to generate the View.
BusinessService
The BusinessService encapsulates the business logic and business state. A remote business service is accessed via a Business Delegate.
| Example for Service to worker |
It’s really a nice and helpful piece of information. I aam satisfied that you just shared this helppful info with us.Please stay us up to date like this. Thanks for sharing.