Java Reference
In-Depth Information
• The business delegate introduces an extra layer that increases the number of
classes in the application. This may be a cause of concern during maintenance.
• If the remote business object interfaces change, the business delegate should take
care of this. In an ideal situation, the page controllers will be unaware of such
internal changes in the business delegate. However, such a thing seldom happens,
and page controllers too are affected by business object changes.
Session Facade
The eInsure application used SLSBs to deploy remotely accessible business logic. These
SLSBs were accessed from the JSP controllers as shown in Listing 4-1. However, as I have
already highlighted, business objects should be accessed from the business delegate.
Soon, eInsure code was refactored, and the Business Delegate pattern was put in use. But
the business service access code that moved from the JSP controller to the business dele-
gate continued to have the original problems. One such problem was the invocation of
multiple remote business methods in response to a user action. The use case “underwrite
new policy” in eInsure could be divided into four subtasks: saving policy details, query-
ing the product workbench to retrieve the default risk and cover list, associating these
risks and cover list to the policy, and finally creating accounting records that will be used
later to track premium payments. Hence, to fulfill this use case, the business delegate
would invoke the four remote business methods.
The approach described in the previous paragraph had immediate side effects. The
fine-grained remote business method invocation from the business delegate increased
network round-trips. This also required large data sets to be marshaled and unmarshaled
over the network for each method call. The end result was the degradation of application
performance. The whole thing was accentuated by the fact that in eInsure the SLSBs
relied on entity beans for persistence. Each of the subtasks used at least two entity beans
to save and retrieve data from the RDBMS. Since entity beans were remotely accessible
persistence components and required data marshaling and unmarshaling, they also
added to the network clog.
Search WWH ::

Custom Search