Java Reference
In-Depth Information
• The application primarily needs to handle a dynamic view generated using
dynamic data.
• Business or data access code are mixed in action handlers.
• The business logic and data access code should be placed in separate layers.
Use server to worker to coordinate request processing workflow by invoking components
in different layers.
Strategies with the Spring Framework
Just like Dispatcher View, Server to Worker is essentially a guideline for building layered
Java EE applications. It is similar to the MVC architectural pattern and proposes that the
application must be divided into distinct layers corresponding to specific roles in a
request-processing workflow.
Server to Worker effectively is an extension of the Dispatcher View pattern. Just like
Dispatcher View, it allows the organization of patterns in the presentation tier, with two
differences. On one hand, it allows working with a dynamic view. On the other hand, it
invokes business logic before passing control to view. The business logic must be
accessed to retrieve the data required for the dynamic view. Server to Worker paves the
way for connecting presentation and business layers. The bridge between the two layers
is provided by the Business Delegate pattern, which we will explore in the next chapter.
The page controllers typically do not directly invoke methods on the actual business
objects. Rather, it invokes methods on the bridge or presentation tier proxy called the
business delegate object . As shown earlier in listings, the business delegate is injected into
the controller by the Spring container. The sequence diagram (Figure 3-19) shows the
complete workflow of a Server to Worker pattern.
Search WWH ::

Custom Search