Java Reference
In-Depth Information
protected void onEjbCreate() throws CreateException {
//use for initialisation
uwrAppService = (UnderwritingApplicationService) this.getBeanFactory().
getBean(SERVICE_BEAN_KEY);
}
}
Note that there is a possibility that an application service will now increase rapidly in
size in order to incorporate complex business rules. It is possible to use a single applica-
tion service per user case just like you do with the page controllers. However, this will
create lot of small classes that are hard to maintain. A more balanced solution would be
to logically group the application service methods. In the case of eInsure, for example, a
particular application service can include the methods to create, update, suspend, reject,
and approve a claim.
Consequences
Benefits
• The business logic is now encapsulated in simple POJO components. These serv-
ices access EJB container services as they are invoked from the session facade.
• POJO components make the application easier to test and run outside the con-
tainer.
• You get improved performance because the session facade relies now on the POJO
application service and data access object combination. It no longer uses entity
beans, which increased the network chattiness.
Concerns
• The Application Service pattern adds an extra layer to the application. This
increases maintenance and development effort.
 
Search WWH ::




Custom Search