Busines delegate / service locator / session facade

i dont understand how to combine all these patterns into one sequence diagram or class diagram. does anyone have a sample for this? thanks a tonne.

i dont understand how to combine all these patterns
into one sequence diagram or class diagram. does
anyone have a sample for this? thanks a tonne.they are invloved with more than just a class. usually they work like this:
client ->bd[locator] ->sessionFacade[locator]->bzObjs/ejbs
and if there is a messageFacade, it goes in between bd and sessionFacade.
hope this helps.

Similar Messages

  • EJB 3.x business delegate & service locater

    Hi all
    are business delegate & service locater patterns still relevant when considering EJB 3.x? Why or why not?
    Does dependency inversion replaces service locater? was there dependency inversion in EJB 2.x??
    Thx a lot

    Hello,
    Business Delegate is still relevant while using EJB 3.0
    Business Delegate reduces coupling between presentation-tier clients and business services, that does not change with EJB 3.0.
    However, Service Locator can be avoided by the Dependency injection provided by java EE5.
    But, remember, Dependency injection works only for object managed by the container, so, Service locator can yet be useful in ejb 3.0.
    Regards,
    Sebastien Degardin

  • Business Delegate, Session Facade or both?

    Hi,
    I'm having some problems with figuring out the point of using both Business Delegate (BD) and Session Facade (SF). As far as I can see, you often have a 1-1 mapping between the BD and SF, so why not use the SF directly?
    Here's my scenario. I have a web application that uses WebWork for presentation and pageflow, a session facade implemented using an ejb, which aggregates calls to the businness objects into "business rule"-methods and business objects implemented using plain java objects. Is there really any need to have a business delegate here? I might as well use the session facade directly from the webwork actions? Or..?
    Any suggestions? Am I far off? ;-)

    As far as I can see, you often have a 1-1 mapping between the BD and SF, so why not use the SFYou can have one Business Delegate encapsulate all of the business methods that are exposed by one or more Session Facades. The benefit here is that you protect the web component from any details of the business tier. e.g. your business tier has five session facades and the web tier has a single Business Delegate. The BD can be extended to call web services as well.
    Here's my scenario. I have a web application that uses
    WebWork for presentation and pageflow, a session
    facade implemented using an ejb, which aggregates
    calls to the businness objects into "business
    rule"-methods and business objects implemented using
    plain java objects. Say you eliminate the EJB implementation. What effect will this have on the web tier objects? The Business Delegate will enable you to easily replace the business implementation with little impact on the web components.

  • Business Delegate & Session Facade

    1 What is the need of Business delegate? For controlling the interactions between the presentation tier and business tier, session facade pattern can be used.
    2 Can a session facade have all the facade related methods. (i.e. entire application has only one session facade). In the pattern documentation, it is stated as this stratergy inefficient. Why is so?

    1 What is the need of Business delegate? The delegate provides a client-side business abstraction and acts as a proxy for the business service. Note that it is a proxy, not a facade. In other words, it is a "stand-in" for the biz service, but it is not aggregating several method invocations into one and controlling the processing flow. So, the delegate is not providing a higher-level interface to some underlying system, as would a facade.
    So what's the need, if it's just a proxy? Obviously, it adds a layer, so one must consider its benefits versus the drawback of writing, maintaining, and interacting with this extra layer. In a sophisticated system, the benefits are many and will usually outweigh the drawbacks. Following are some of the benefits of using a delegate in the web container as an access point for invocations to the business tier:
    - It hides the underlying implementation details of the business service (ie: lookup, creation, access details of EJB...The delegate may use the Service Locator pattern to achieve this goal).
    - The delegate translates exceptions as necessary. Service-level exceptions, such as java.rmi.Remote can be intercepted by the delegate and translated into application exceptions. This also helps shield web container clients, for example, from EJB and network-related implementation details, which they should not need to worry about.
    - The delegate can attempt retries/recovery efforts transparent to its clients, such that this code can be localized and reused, instead of being duplicated in numerous clients.
    - The delegate can also manage a cache of resources/results, limiting unecessary remote roundtrips
    - The delegate can be used as a control point for multi-threaded access into the business tier. For example, stateful beans are not to be invoked by multiple client threads simultaneously. The delegate can serialize access, or, as mentioned above, handle exceptions/retries, as necessary.
    For
    controlling the interactions between the presentation
    tier and business tier, session facade pattern can be
    used.If you decide to use a delegate in your system, based on considering its benefits, as described above, then you'll typically create a one-to-one mapping between a delegate and a session facade. The delegate is not controlling the processing flow per se, but rather serving as a single access point and proxy as described above. The facade acts as a controller, though, aggregating the interfaces of underlying components and subsystems into a higher-level interface. If you find that your using the delegate more as a facade, we recommend pushing this control code from the web container (where the delegate lives) back to the session bean in the ejb container, so that the logic can be reused across clients.
    >
    2 Can a session facade have all the facade related
    methods. (i.e. entire application has only one session
    facade). In the pattern documentation, it is stated
    as this stratergy inefficient. Why is so?Having a single facade for the entire system would prove to be quite a maintenance and manageability headache for a non-trivial application. Imagine that every time something changes in any subsystem of the service layer, developers are all making changes to the same file and the same class...Not desirable and not very elegant. At the same time, one does not want to go the other way and create too many facades by having a one-to-one mapping of session facades to use cases, for example. We recommend aggregating a group of related interactions into a session facade, so that it provides highly course-grained access and control to underlying components.
    Thanks,
    Dan

  • Bussines Delegate -- Session Facade

    Hi,
    My design is:
    client --> bussines delegate --> session facade ---> application service --> dao
    ........................................................................................................|
    ........................................................................................................|
    ......................................................................................................pojo
    I have 2 session facade: PurchaseManagement and InventoryManagement.
    I have a use case that need access to services provided by both session facade.
    Which is the best solution?
    1- Define a bussines delegate for each session facade and the client use both bussines delegate
    2- Define a unique bussiness delegate that access to both session facade
    3- ????
    Thanks.

    I have 2 session facade: PurchaseManagement and
    and InventoryManagement.
    I have a use case that need access to services
    ces provided by both session facade.
    Which is the best solution?
    1- Define a bussines delegate for each session
    ion facade and the client use both bussines delegate
    2- Define a unique bussiness delegate that access
    ess to both session facade
    3- ????If you are using a client-side Business Delegate, you do not need a one-to-one mapping to each Session Facade. The single Business Delegate should be composed of business methods from both Session facades. This will help keep the application modular. If you ever decide to change the design of the business tier, nothing will have to be changed in the presentation tier.
    Best,
    Sam
    http://www.softwareleadership.org/docs/overview_UW_RPM.html

  • Service Locator and session facade pattern

    What are differences between Service Locator and session facade pattern?
    For me it seems one and the same.
    Please explain me in detail. Expecting kind help.
    Thanks,
    Rahul
    Edited by: rahulb1 on Feb 26, 2008 5:07 PM

    rdoekes wrote:
    The ServiceLocator Pattern is a singleton which hold a map of used DataSources. The idea is that you perform a lookup once and use the cache afterwards. The session facade is just one DataSource lookup.huh? Those J2EE patterns are not really reduced to datasources and the SessionFacade has actually nothing to do with datasources.
    Session Facade
    It has Facade in it and a Facade is usually used to give a simple entrypoint by providing a standartized interface. The same is now with the Session Facade. You have a Session bean that represents a high-level business component that interacts and calls lower-level business components.
    Imagine having client a accessing 5 business objects with the remote calls, which is not an efficient way (network latency) or accessing the SessionFace and the session face is doing all the work through local access.
    Service Locator
    As J2EE components are using JDNI to lookup for ejb interfaces,DataSources, JMS components, connections etc. isntead of writing all the lookup in many code piecess across the project, you write a service locator that gives you a centralized place to handle the lookup's. It's easier to maintain and to control such a setup.
    As you can see there's quite a big difference ;-)
    cya,
    Nail

  • === SESSION FACADE v/s BUSINESS DELEGATE ===

    Hi
    Can anyone help me with my design here - I am not sure whether to use a Session Facade or a Business Delegate in the following scenario:
    [Our application is pure J2EE and does not use EJBs]
    PRESENTATION-TIER
    I have a Command and Control strategy employed in my presentation tier where requests are intercepted by a controller and processed by helpers delegating to appropriate commands and dispatch appropriate responses.
    PRESENTATION-TIER - COMMANDS
    The Commands will invoke appropriate Business Methods in the business tier to retrieve data (mostly).
    BUSINESS-TIER
    Now - most of my business methods use the DAO pattern to retrieve data and are effectively dealing with Data Beans (Value Object beans) - passing them back to commands.
    I can clearly see the use of a generic Interface at the Business tier - i.e., rather than expose the Buiness Methods direcly leading to increased coupling between presentation and business tiers.
    BUT THE CONFUSING PART IS - DO I USE A SESSION FACADE OR A BUSINESS DELEGATE TO INTERFACE WITH MY COMMANDS??? What is the difference? I have looked at Sun's J2EE blueprint and cant make out the clear cut difference between the two.
    Can anyone help?
    thanks
    Aswin

    I agree with you, Business delegate and Session facade are quite alike.
    I believe that you could use the Business delegate pattern as a facade. Possibly, you could argue that the Business delegate is an extension of the Session facade pattern. However, I think that SUN thinks that a Business delegate should be a singleton while a Session facade is a session EJB. My firm belief is that you could create a business delegate that is a session EJB instead.
    But, you could also use both pattern as some one else suggested.
    In your case when you do not use EJBs, I would suggest that you use a facade which could be design like a business delegate. However, as there aren't any EJBs, you will not need a service locator. In this way, you will have a design that can be extended (without any impact on the the presentation tier) to use EJBs in the future.
    Remember, SUN's core J2EE patterns assume that you use EJBs. If you don't, they have to be adapter a little bit.

  • Business Delegate and Session Facade

    Business Delegate as well as Session Facade are used to reduce coupling between presentation-tier clients and business services.
    Could someone provide the key differences between these two patterns.
    And one more, is Session Facade applicable(can be implemented) only to Enterprise Java Beans? Or even a POJO can be a Session Facade
    Thanks in Advance

    Business Delegate as well as Session Facade are used
    to reduce coupling between presentation-tier clients
    and business services.
    Yes. And also in EJB to overcome some of the deficiencies in distributed architectures.
    Could someone provide the key differences between
    these two patterns.
    Business Delegate is used by a client whereas the Session Facade is used to abstract a business service.
    And one more, is Session Facade applicable(can be
    implemented) only to Enterprise Java Beans? Or even a
    POJO can be a Session Facade
    Yes. Think of a session facade as your 'easy' or 'high-level' API. Your actual business tier may have its own 'low-level' API that callers should not have to interact with or understand.
    Thanks in AdvanceYou're welcome.
    - Saish

  • Business Delegate and Session Facade usage.

    Hi guys.
    I am new to JavaEE and I recently learnt the Business Delegate and Session Facade design patterns. The tutorials from Oracle did gave me a basic idea of what they are and why they are used, but the example didn't really answer all my questions. So I decided to use a real life scenario here and put my question in to it. Any help is appreciated.
    Assume I want to create a search employee page for my company, the employees are categorized by his or her department and the province he or she is in. I have in the database a look up table for department and province. (as shown in the image below)
    http://oi46.tinypic.com/idvpsl.jpg
    So I create three JPA entities, one for each table. Now I am stuck with what is the proper way to design the session facade design pattern. I know that I will need the to access all three entities in my page. (to get the drop down list for Provinces and Departments, and to retrieve list of Employees based on the selection) So should I create a Stateless Session Bean as session facade to access all three JPA Entities or should I create three separate Stateless Session Bean to manage one Entity each?
    I came up three component diagram in the below picture.
    The first one has one Stateless Session Bean as session facade and manages all three Entities.
    The second one has a session facade to manage the relationship between business objects such as ProvinceManagerEJB and DepartmentManagerEJB which will manage the corresponding Entities.
    The last one has three Stateless Session Beans that will manage one Entity each, all three Stateless Session Beans can be looked up via the Business Delegate pattern.
    http://oi46.tinypic.com/10pqets.jpg
    Please let me know if any one of them is the proper way to use business delegate and session facade. or none of them is correct. (which I assume might happen)
    Again, thank you so much for your help.
    Cheers
    Edited by: 992005 on 05-Mar-2013 18:15
    Edited by: 992005 on 05-Mar-2013 18:17

    Well I can't access any of your diagrams from here so can't comment on them. For dividing the functionality into separate classes, think about
    1.) Quantity - Are there many enough service calls to require splitting up or will one application service class be enough? The size of the system is important here.
    2.) Are you duplicating logic in the services? e.g save person, delete person in one service and save department, delete department in another e.t.c is better factored into one service with save entity, delete entity calls because the JPA entity manager doesn't know about the type anyway and it's easier to apply common logic (e.g logging auditing) around the calls.
    3.) Will each service makes sense on it's own or do you always need the other functionality to completely describe the service? Here it is important not think about entities but about the business use cases. Process1Service is better than Entity1Service, Entity2Service ... EntitynService.Think granule of reuse = granule of release. Only split out individually reusable services. A good way to understand granules of reuse in your system is to think about (or start by writing) test cases for the functionality. Testable code is reusable code.
    4.) Will the services change together? At class level you would look at common closure principle (classes that change together should be packaged together). You can apply the closure to the methods as well. Make it easy for future developers to recognize dependent functionality by packaging it together.
    These are just general because in enterprise development requirements are king. You can chose to follow or discard any of these rules depending on your requirements as long you understand the impact of each decision.

  • Business Delegate / Session Facade interaction questions

    I understand the concept and the benefits of a business delegate "front-ending" a session facade. I am hoping that someone can answer the following questions:
    Is it acceptable if a business delegate were to front-end more than one session facade in order to create a more unified service. For example is it ok to create one business delegate that provides Account Inquiry and Maintenance functionality and behind the scenes it talks to an AccounInquiry Session Facade and AccountMaintenance Session Facade?
    We are looking at a designing a Account Inquiry business delegate. It will return an AccountProfile business object. A behaviour of the AccountProfile object will be update capability (i.e. update account status, modify balance, etc.). Considering that the business object is a "business tier" component, is it ok fif it were to talk directly to an Account Update Session Facade or instead should it use a business delegate which in turn will call the session facade?

    I understand the concept and the benefits of a
    business delegate "front-ending" a session facade. I
    am hoping that someone can answer the following
    questions:
    Is it acceptable if a business delegate were to
    front-end more than one session facade in order to
    create a more unified service. For example is it ok to
    create one business delegate that provides Account
    Inquiry and Maintenance functionality and behind the
    scenes it talks to an AccounInquiry Session Facade and
    AccountMaintenance Session Facade? This is a feasible solution. As long as you have 1:2 ratio or a ratio which is very less, it is fine. But one of the intents for having this pattern is also to make the client's life easier. If the client who's using your delegate is someone else, sitting else where, he/she would be wondering about the reason for a single class like AccountInquiryMaintenanceDelegate providing two different functionalities. So, this has to be kept in mind before coming up with a single class.
    We are looking at a designing a Account Inquiry
    business delegate. It will return an AccountProfile
    business object. A behaviour of the AccountProfile
    object will be update capability (i.e. update account
    status, modify balance, etc.). Considering that the
    business object is a "business tier" component, is it
    ok fif "it"what does "it" mean here?? Did you mean the 'AccountProfile' bussiness object?? or the AccountInquiry business delegate??
    were to talk directly to an Account Update
    Session Facade or instead should it use a business
    delegate which in turn will call the session facade?
    HTH,
    Kalyan

  • Difference between session facade and business delegate patterns

    Hi,
    How the session facade and business delegate patterns differ from each other, as both of them have similar and almost same forces to be addressed.
    Please address.
    Satya.

    BTW, in J2EE Core patterns :
    When the Business Delegate is udes with a Session Facade, typically there is a one-to-one relationship between the two. This one-to-one relationship exists because logic that might have been encapsulated in a Business Delegate relating to its interaction with multiple business services (creating a one-to-many relationship) will often be factored back into a Session Facade.[I/]

  • Difference between Session Facade and Business Delegate??

    Hello,
    I am currently working on design patterns and I am confused what the difference is between the Session Facade and Business Delegate pattern. They look identical.
    What's the difference?
    Balteo.

    We implement Business Delegators (BD) as follows:
    1. The client always talks to the BD.
    2. The BD then talks to either our Session Facade, Session EJB, or Java Class, etc, etc directly.
    This allows the client end code to never change whilst allowing our BD to swap between different providers of the service we require.
    It's the good 'ole "layer of indirection" thingy.

  • Diferences between Business Delegate and Session Facade

    Hi, I've been programming with java for a long time now, but recently decided to formally studing the J2EE patterns. By now I have the intuition of many of them but in paper looks a little confusing. Let me ask you what is a clear diference between Business Delegate and Session Facade.
    For me, exposing interfaces, hiding implementations and masking the complex interactions in the back are common factors in these patterns, could you please help me to identify diferences?

    There are more subtle differences, but the basic gyst is that the Business Delegate is used on the client/presentation tier. The Session Facade is used on the server/service tier. The Business Delegate typically performs a lookup of the SessionFacade which in turn fronts a service method (EJB or otherwise). The Business Delegate pattern is typically associated with J2EE remoting and its shortcomings.
    - Saish

  • Bussiness Delegate vs Session Facade.

    Hi,
    Please any one tell me what are the differences between Bussiness Delegate and Session Facade.
    I read some documentation in online but not clear in above two design patterns.
    Any help I will appricate.
    Thanks,
    CDulla.

    A business delegate is generally thought of as a plug-in that is given to the client developer. This "plug-in" can do service lookups and searches on behalf of the client developer. Very smart if you have a Swing or Servlet Developer that doesn't know ejbs.
    A session facade is a session bean that is much like the delegate but resides on the server and is used to encapsulate course services so that network can be held to a minimum.
    A business-delegate can call a session facade which in turn can call an entity bean

  • Business Delegate and Service Locator

    Hi all,
    I read the Business Delegate Pattern
    and my question is about how many Business Delegate
    I must write:
    a) one for every Session Beans ?
    (in a Session Facade Pattern)
    b) one for all Session Beans ?
    Is it right that I must have a single Business Delegate
    and different Service Locators if I need to
    call the same EJBs deployed inside different Application Servers ?
    Many thanks in advance,
    Moreno

    Please explaine your Question in more Detail?

Maybe you are looking for

  • Performance: Cursor declaration versus explicit query in BEGIN/END block

    Hi guys! Anyone knows if declare an explicit cursor inside a pl/sql block is faster than using a cursor declaration, and how fast it its? Which block runs faster? And how fast? ( once, twice, once and a half ? ) Block1: DECLARE CURSOR cur_test (p1 NU

  • Topic Footers Appear in Word Document

    Topic footers appear in Word document. This seems to happen when a snippet is used at the end of the topic.

  • SAP* not authorized after Client copy

    Dear All, Here's the scenario: 1. Created a new logical system for a new Quality client 230. 2. Created the new client 220 3. scheduled a test remote client copy from the new client, source Production. (Successful) 4. Scheduled the actual client copy

  • I cannot watch a movie and I've bought it

    To whom it may concern, Last month I purchased a movie called Hitchcock at the price of $14.99. However, I failed to watch it, and it just cannot stream properly. I want to either cancle this purchase or fix the streaming issue. Could anybody check a

  • IPad Air gets suddenly white screen and black apple

    When I am working, my iPad Air gets suddenly (one or two times per week) white screen and black apple screen for a few seconds before I get back the control, anyone has the same problem?