• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FrontController and Service to worker

 
Claudio Malso
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the main difference between these two J2EE patterns ? Can I use just one servlet getting both roles ?
Thanxs,
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does not make sense to compare Front Controller and Service to Worker. The Service to Worker Pattern is built on top of the Front Controller Pattern.
It would be more appropriate to ask what is the difference between Service to Worker and Dispatcher View. Which, by the way, is directly addressed in the Service to Worker Pattern description: here.
 
Claudio Malso
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"The Service to Worker pattern is the result of combining the View Helper pattern with a dispatcher, in coordination with the Front Controller pattern. "
Sorry Chris, but let me clarify if I`m understanding right...if I use the patterns
- Front Controller
- View Helper
- Dispatcher View
Have I got a Service to Worker ?
 
dwarika nath
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Service to Worker
As in the real world, we want assign tasks to each individual based on their skills and knowledge and expect the results coming back to a center place for organization and assembling. Service to Work pattern works the same way, user request will forward to certain module, a worker or a action module, which responses for certain task. The worker will work its way to backend data resource, directly or through other backend design pattern module, and gets the results back.

Service to Worker pattern usually works with Front Controller. The Front Controller is responsible to delegate the request to a worker module.



Service to Worker pattern is usually implemented as Java class. In the sample, we call it Action, in the meaning of an action triggered by a user request.

Dispatcher View
Dispatcher View pattern works the same way but the opposite direction of Service to Worker pattern. Once the user request has been processed, the Front Controller should return a view along with data back to user. The task can be delegated to the Dispatcher View module. Based on the user request, data or predefined dispatching strategy, the dispatcher will return an appropriate view back to user.



Dispatcher View is usually implemented as Java Class.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by deva bhatta:
Service to Worker
As in the real world, we want assign tasks to each individual based on their skills and knowledge and expect the results coming back to a center place for organization and assembling. Service to Work pattern works the same way, user request will forward to certain module, a worker or a action module, which responses for certain task. The worker will work its way to backend data resource, directly or through other backend design pattern module, and gets the results back.

Service to Worker pattern usually works with Front Controller. The Front Controller is responsible to delegate the request to a worker module.



Service to Worker pattern is usually implemented as Java class. In the sample, we call it Action, in the meaning of an action triggered by a user request.

Dispatcher View
Dispatcher View pattern works the same way but the opposite direction of Service to Worker pattern. Once the user request has been processed, the Front Controller should return a view along with data back to user. The task can be delegated to the Dispatcher View module. Based on the user request, data or predefined dispatching strategy, the dispatcher will return an appropriate view back to user.



Dispatcher View is usually implemented as Java Class.


Nice explaination.
 
Muhammed Shakir Ak
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent Explanation Devesh
 
Naresh Dhiman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
good explanation
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic