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?

Similar Messages

  • 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.

  • 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

  • What is business systems and services?

    Hi Experts,
    What is business systems and services and where are they prefered? and tell me the diff between them...
    Regards,
    Mahakrishnan T.

    Hi
    Business System
    1) Business system is a logical system, and there is an importance on physical existence of the system.
    2) Also SLD entry is required.
    3)It is generally used for SAP applications, this is just a general prinicple followed but not mandatory.
    4)This is defined as part of the SLD and is a physical system whose parameters are well defined.
    5(Business systems refers to the physical systems, for instance the R/3 system. You define the business systems in the SLD
    Business Service
    1) You use a Business Service, when you do not have the System details of the the partner system to which you want to communicate. i.e. you have not configured the partner system in SLD.
    2) Business Service is an Absract Unit with Sender and Receiver Interfaces,In this case you need to explicitly add the message interfaces while doing configuration in ID.
    3) It is generally used for NON-SAP applications, this is just a general prinicple followed but not mandatory.
    4) This is not defined as part of SLD and whose technical parameters are not completely known.
    5)Business service is used when the message is not addressed to a business system. It is used mostly in B2B scenarios.
    Regard's
    Chetan Ahuja

  • Business delegate and Session facade design patterns

    Does any one tell me, what is the difference between business delegate and session facade design patterns.

    1. Session Facade decouples client code from Entity beans introducing session bean as a middle layer while Business Delegate decouples client code from EJB layer ( Session beans).
    2. SF reduces network overhead while BD reduces maintenance overhead.
    3. In SF any change in Session bean would make client code change.
    While in DB client is totally separate from Session bean because BD layer insulate client from Session beans(EJB layer).
    3. In only SF scenario, Client coder has to know about EJB programming but BD pattern no EJB specialization needed.
    4.SF emphasizes on separation of Verb, Noun scenario while BD emphasizes on separation of client(presentable) and EJB layer.
    Anybody pls suggest more differences ?

  • Difference between business activity and service process in transaction

    Hi Friends,
    Can anyone explain me  the difference between business activity and service process in transaction category of service desk
    Thanks & regards,
    Shanmugam Balamurugan

    Hi,
    Activity means e.g.. sales call, customer visit etc.
    But service process means after you sale your product if some service related issue arrives then that is taken care by this transaction.
    Inspire by rewarding.
    Regards,
    Nikhil

  • 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 Pattern

    Hi!
    The only way to use the Session Facade Pattern, is if I use EJB for Persistence.
    Is valid to do this?:
    I use Ejb for simple update, insert querys. From my business delegate I call the Session Facade Layer, and from this I invoque Entyties for persistence.
    But if I have complex querys, is correct to make PL SQL Procedures and do the following:
    From my business delegate I call to the Dao layer, and from this via JDBC I call the Procedure.
    Please explain me the best form to do this, having complex querys for reporting and simple querys for inserts/update.
    Is valid to combine the use of CMP (for simple persistence cases), BMP (for complex persistence cases), and JDBC for complex select querys with multiple result rows.
    Thanks!!

    It depends on your design goals. One of the forces driving the use of patterns is the desire to tier an application and abstract the internals of each tier away from the other tiers. One (normal) benefit of this methodology is that the application should become more portable. Now, if you are using PL/SQL, BMP and CMP, you are mixing and matching portable versus proprietary. This is okay. But you should abstract away whether you are using PL/SQL, BMP or CMP from the business layer (or domain model). Ideally, you could completely swap database technologies (say from relational to object) and only have to re-write your integration tier (your DAO's).
    Session facade is simply a glorified Facade pattern. It abstracts the lower-level details of what you are persisting and instead forces you to think in terms of objects. You can use a facade without even remotely touching EJB's. It just so happens that, historically, EJB containers made a mess out of scalability when it came to entity beans. The "session" facade refers to a facade pattern implemented in session beans (that have fewer scalability problems) communicating with the entity beans which do have scalability problems.
    So... to make a long story short, use whatever persistence mechanism you desire. Remember that you should be able to completely switch your persistent store from one type or another and simply re-write your DAO's (or CMP deployment descriptors). Using a facade pattern can help towards this end, but don't make it a straightjacket.
    - Saish
    "My karma ran over your dogma." - Anon

  • Business Delegate pattern - need some advice

    Hi. First let me apologize for the long post. I could see no other way. I�m building a system that quite large and I need some advice. The system is a type of transaction system, let�s suppose a shopping cart. I�m using struts taglibs and tiles for presentation, struts proper for controller, and POJOs for business logic. Also I�m using OJB for my data tier.
    Now I�ve been reading Pro Jakarta Struts (Apress), which BTW is a recommended read to anyone with novice experience in struts and related technologies. I�ve assimilated most of the techniques and patterns described in the book, and most of them make sense to me. However, I�ve hit a snag while reading the Business Delegate and Service Locator patterns.
    The way I had though of building my application before reading the book, was to have a wrapper class, such as the following:
    public class ShoppingCart {
      private IAuthenticationService authenticationService;
      private ITransactionService transactionService;
      public ShoppingCart() {
         authenticationService = new DBAuthenticationService();
         authenticationService = new DBTransactionService();
      public login(String username, String password) {
         String sessionToken = authenticationService.logon(username, password);
         return sessionToken;
      private boolean isValidUser(sessionToken) {
         bolean validUser =  authenticationService.isValidUser(sessionToken);
         return validUser;
      public performTransaction(sessionToken, TransactionVO) {
         if (!isValidUser(sessionToken) {
              throw new AuthenticationException();
         transcationService.performTransaction(TransactionVO);
      public editPreferences(sessionToken, PreferencesVO) {
         if (!isValidUser(sessionToken) {
              throw new AuthenticationException();
         authenticationService.performTransaction(PreferencesVO);
    }My idea was that my wrapper class would isolate all the business logic and could perform login service in case my application was ever to be used with other presentation layer than struts (standalone client, web services). However I believe that this overlaps the Business Delegate pattern and maybe even totally implements it. The way I understand the code I�m reading in the book, they suggest having a BD for each major service such as AuthenticationServiceBD, TransactionServiceBD, etc� However this would break my single point of entry for authenticating users. I really need some advice on my design and how it fits with the BD and SL patterns (or others). I would also like to know what you think/recommend of my authentication strategy.
    thanks in advance
    Raphael

    Thanks for your reply. This however, I understood. My concern is regarding my application in regards to business delegate pattern. You see I have this class (simplified for clarity):
    public class ShoppingCart {
       private ILoginService ls = new DBLoginService();
       private ITransactionService ts = new DBTransService();
       // and so on for all services I offer.
       //  then I mirror all the calls of my private interfaces
       //  and pass them through internally
       public String sessionToken login(String username, String password) {
            ls.login(username, password);
       public boolean addToCart(sessionToken, itemNo) {
            // check session
            ts.addToCart(sessionToken, itemNo);
       //  and so on
    }Multiple questions for this one:
    1) Am I not already implementing the Business Delegate pattern with my ShoppingCart class since all interfaces are private and all calls are mirrored from the wrapper class (ShoppingCart) to the private interfaces? All services are implemented as POJOs and I am not using JNDI at the present so I don't use the ServiceLocator pattern.
    2) I store a reference to the wrapper class (ShoppingCart) in the ServletContext so I can grab it from my Action classes. What do you think of this approach?
    3) How many BDs should an application contain. In my case I use just one. What is the advantage of using more?
    4) I create my own session tokens in case I ever want to use to business code in a non-web applications where sessions are not available readily. This brings about the problem that I can't pass the interfaces directly to the Action classes because the login session needs to be checked before any calls to services. So all methods include a sessionToken parameter which I use to check the session. This way, if I want to expose some of the services through web services, I can still use a login. What do you think of this approach.
    5) Any other remarks are very welcome...
    I really need help with this from an experienced programmer. Most things I can handle on my own but with this type of design issue, books just don't cut it. I need experience. I would really apreciate some feedback.
    Raphael
    ps: I would give all my Duke dollars for this (I only have 30), but I'm not sure how. If you want them I can create a dummy question and give them to you.

  • Design - Business delegate

    Hi,
    I am designing a j2ee application has 2 clients browser and swing application, I am trying following approach
    =>Create a common business delegate and service locator so that it can be shared between 2 clients.
    My question is
    1. can I have multiple business delegates based on my requirements?
    2. How do I handle session on swing client? my business delegates are calling stateless beans.
    CLIENT->BD->SERVICE LOCATOR->SLB
    Appreciate your response.
    Pramod.

    Please explaine your Question in more Detail?

  • Parties, Business Systems and Business Services

    Hi guys,
    I've read a lot about items in subject, but have some doubts about applying them to my scenario. I have to integrate SAP system and web service.
    As far as I understand concepts, this is B2B communication, so I have to use parties. To represent SAP system I use Business System, as it's described ins SLD,  and for Web service I use Business Service... just as we use business services for web services
    --- Am I right here? Will it work ok in reciever determination, agreement?
    Thank you.

    Hi,
    You are doing the usage of business systems and services in proper way.
    The scenario will difinately work with combination of business system and service.
    It will be fine for all other configurations such as Receiver Determination, Sender/receiver agreements and interface determination etc.
    Please see below the importance of Parties, Business Systems and Business Services 
    A communication party
    A communication party (party for short) represents a larger unit, which is involved in a collaborative process. Using a communication party, you generally address a company within a cross-company process. 
    You can assign a communication party one or more services to address it as the sender or receiver of messages.
    A business system
    If you want to address a particular business system as the sender or receiver of messages, choose this service type.
    A business system is an actual application system in a system landscape. A business system (service) comprises information about the inbound and outbound interfaces and the software component versions of the business system.
    You usually use business system services when configuring internal company processes.
    A business service
    If you want to address an abstract business entity as the sender or receiver of messages, choose this service type.
    Using a business service, you can define the technical or business subunits of the companies involved and then assign them the relevant interfaces.
    You usually use business services when configuring cross-company processes. In this case, you only make your interfaces known to the business partners involved and either do not make any details about your own system landscape available, or only specific details. 
    For example, you can define RosettaNet Partner Interface Processes (PIPs) as business services.
    Thanks
    Swarup

  • === 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.

  • Parties and Services in Configuration Scenarios

    Hi,
    I think I understand the distinctions between parties, business-systems, and -services.
    If I define an integration scenario in the repository and check the checkbox b2b-communication, I have to use parties in the directory integration scneario configurator.
    Do I then also have to provide a partner for my own company and assign my business-systems and services under this node? I otherwise get problems when I assign the services to the application systems in the configurator and my receiver determinations get wrong.
    Any thoughts and information about this topic is welcome.
    Thanks,
    Hans

    Hi Hans,
    it is not necessary to define your 'own' party if you only have 'intra-enterprise message exchange'. The big deal about parties is the possibility to define 'additional' IDs like DUNS-numbers to the Party - this is necessary whenever an Adapter is used that requires specific IDs (these are typically B2B Adapters only). The Receiver-Adapter (for messages coming into the Integration Server) will map from an additional ID to the XI-Party name and the Sender Adapter (for messages sent out of the IS) will map from the XI-Party name to the additional ID as defined within the Sender channel.
    In other words: parties are needed, whenever one Communication Partner's message format expects meaningful values according to a specific schema - not only in the payload but also in the message header (liek RNIF).
    Please be also aware, that the Scenario Configurator tries to capture typical use cases - it can not handle everything so it is possible that one has to change objects afterwards.
    regards, frank

  • 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

  • How to map business process and enterprise service?

    Recently, I read some documents about ESA. I'm confusing about the relationship between business process and enterprise service. In other word, how to map the business process to enterprise service after the business process is analyzed? Is there any methodology/rule to define business process and wrap them into service in ESA?

    Hi Sherry,
    I like to add some of my thoughts about that discussion. From my point of view ESA is much more than just another BPM or Enterprise BPM. ESA is adresses six key areas and I think all of them are really needed:
    - <b>People Productivity</b> as the word itself describes...it's about portals and productivity.
    - <b>Embedded Analytics</b> has to integrate transactional and analytical content.
    - <b>Service Composition</b> is used for model-driven service composition and services orchestration.
    - <b>Service Enablement</b> is about a Enterprise Services Repository filled with business meaningful Enterprise Services and service patterns for enabled objects. Excactly this is where SAP has years of experiences.
    - <b>Business Process Platform</b> is about service enablement of all application platform objects and engines. This is the place where "BPM" for core business processes resits.
    - <b>Life-Cycle Management</b> has to cover the deployment, configuration, operation and change management for ESA based processes.
    Therefore the term "BPM" is located in serveral layers of an ESA approach. On the level of <u>Business Process Platform</u> BPM is providing the choreography for core business preocesses.
    At <u>Service Enablement</u> BPM needs to compose out of granular services (I would say "atomic" services)
    buiness meaningful services (here we have "molecular" services).
    The third level where BPM could be used is <u>Service Composition</u> because exactly this is the place
    where serveral Enterprise Services could be combined to a process representation.
    To come back to the discussion:
    1. The question should be how to indentify business meaningful services which could represent single process steps. ATP check, Credit card check, ... could be examples. In theory this service could be out-tasked, defined more flexible etc. This means that processes needs to be evaluated for Enterprise Service candidates. Afterwards you can check against SAP's Enterprise Services Repository for already existing Enterprise Services. The evalution for enterprise services candidates will be supported by the metodology mentioned by Kaj and David.
    2. I think domains in this context should be motivated by business and/or functional areas. Depending on the granularity. For example Order Fulfilment Services, Master Data Services, Search Services... These kind of serices can be combined again to services such as "Search of Master Data" (Search Service + Read Master Data Service) etc. or can be used to generate UI to be used in a ESA application.
    Your thoughts?
    Very best regards
    Wulff

Maybe you are looking for

  • You don't have Add and Customize Pages permissions required to perform this action - but i do!

    Hello. I am having a similar problem to the one described by this post here: http://kiruthik.com/2010/10/05/YouDontHaveAddAndCustomizePagesPermissionsRequiredToPerformThisAction.aspx However, his resolution of changing web.config under wwwroot did no

  • App Store crashes, Share button crashes, Security in Preferences panel crashes

    Background - Late 2010 MBP 15" i7, upgraded to 8 GB memory. Came with Snow Leopard, Upgraded to Lion without clean install. Worked perfectly. Have CleanMyMac installed on it. Problem - After upgrade to Mountain Lion, again, update from App Store, no

  • Can you configure a static port to use with certsrv.msc?

    I am trying to use certsrv.msc to connect from my workstation to the CA for administration purposes.  Workstation is Win7, CA is 2008 R2 Enterprise running Enterprise Subordinate on a dedicated box. I configured a static DCOM port for certsvc by foll

  • Non english password

    Hi, why i can't input a non english characters in a password. My native language is russian and some of my friends use a none english characters in login and passwords. But in a password my mac mini with lion don't alloy this. What i should do to fix

  • Email address and uploading through DPS

    I have a Professional account for DPS and with that, I use the Adobe ID-related email address (that was registered to the account when it was set up) to upload my folios. But say my company needs to build and upload say 3 folios in one day - do all t