Originally posted by Anil Vupputuri:
According Service-to-Design Pattern, the flow something looks like,
Client -> Controller -> Dispatcher -> Session Facade -> Business Service (EJB)
Originally posted by Larr Goneg:
But in this case, what's the benefit of BD(dispatcher), since every BD only deal with one Session Facade, actually both BD and session facade has the exactly same methods, why not call session facade directly from controller?
Originally posted by Ajith Kallambella:
Use of BD decouples your clients from the enterprise tier and hides details such as JNDI lookups for the session facade(ServiceLocator) and in some implementations, can actually store the home reference to the session facade. BDs are also very handy if you have non-web based clients. In such a scenario, you may not have the controller which is typically a Servlet. Bundling BDs with stand-alone client jars is a very popular practice.
BDs normally have the same set of methods as the SFacade, but nothing precludes you from adding more behavior to BDs. For instance, a BD can act as a "business controller" and selectively choose an appropriate facade to service the requiest. For instance, a BankingServiceBD can look at the request parameters and select either a TellerFacade or a CustomerFacade to service the request. In this case, although the BD exposes just one method to the client, there is some business intelligence involved in how the request is processed and such nuances are neatly hidden from the clinet.
Hope this helps,
If I have non-web based clients, for example, using RMI to access EJB tier directly, can I still reuse the same business delegator?
So, in an application, the number of BD should always less than the number of session facade. normally there should be only one BD, for ext., in this Banking applicaiton, there maybe only one BD that is BankingServiceBD, am I right?
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton