Help me Developers  on sessionFacade and Business delegate

Dear All What is the difference B/w sessionFacade and Business delegate pattern .I have gone through the tutorial.

hi,
quickly, interface describes (methods/functions of) Objects which implements it, while abstrat class contains 'working' methods/functions. If you have severals Objects that have the same methods/functions what all are implemented different ways, use interface. If some methods/functions do the same thing use abstract class.
simple example:
public interface Pet{
public String getName();
public String familly();
public abstract class AbstractPetImpl implements Pet{
private String name=null;
public AbstractPetImpl(String name){
this.name=name;
public String getName(){
return this.name;
public class Dog extends AbstractPetImpl{
public Dog(String name){
     super(name);
public String familly(){
return "I'm a dog";
public class Cat extends AbstractPetImpl{
public Cat(String name){
     super(name);
public String familly(){
return "I'm a cat";
public class Test{
public static void main(String args[]){
Pet a=new Cat("Kitty");
Pet b=new Dog("Rex");
System.out.println(a.getName());
System.out.println(a.familly());
System.out.println(b.getName());
System.out.println(b.familly());
hope this helps.

Similar Messages

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

  • Difference between Session Facade and Business Delegate design patterns

    Can someone tell me the differences between Session Facade and Business Delegate 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 Proxy pattern and Business Delegate pattern

    Hi All,
    Can any one please tell me what is the difference between Proxy pattern and Business Delegate pattern.
    Thanks in advance.
    Basak

    The books they were first reported in, and the expressed intent, I guess. Arguably, the Business Delegate pattern is a special case Proxy, with more specific details about what resource is being proxied

  • Session Facade and Business Delegate 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!!

    The session facade is borrowed from the facade pattern, so you could have a facade to almost anything.
    A session facade is usually against other beans...for example if you
    (Not deployed as CMR)
    1. Address bean
    2. Phone Bean
    3. Customer bean
    as entity beans then you can build a session facade such as
    CustomerFacadeBean which will CreateReadUpdateDelete(CRUD) address and phone as well when a customer is CRUD ed.
    In your case you said you have very complex sql's so one way would be
    Business Delegate -> Session Facade -> (Bean Managed) Entity Bean -> DataAccessObject.
    If you think this is a overkill then, write a custom pattern such as DataDelegate
    DataDelegate -> (Bean Managed) Entity Bean -> DataAccessObject.
    In the above scenario you should be quite sure that the system will not evolve into a case mentioned above such as when customer is deleted a phone and address object are also thrown away.
    You said this scenario
    Business Delegate -> DAO..
    I don't think this is a good idea because, a business delegate is a proxy against business objects....and usualy in J2EE business objects are session beans. Entity and DAO objects are data objects not business ones.
    Besides if you do the above scenario you will end up wiring all the transactions, etc etc in your DAO which is not a good idea.
    Although you could use BusinesDelegates against entity beans it will lead to a misnomer.

  • 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

  • ITunes10.5.2  and MS Office Home and Business 2010 (running on MS Windows 7 32-bit SP1): can you help me please?

    I've a PC running W7 32-bit SP1 and Office Home and Business 2010. The issue is that iTunes last version (10.5.2) doesn't work with Outlook 2010 and vice versa. With iTunes installed Outlook 2010 doesn't open itself.
    No error message, but the program doesn't open.
    I tried the restore, but nothing even so.
    Either-or: or iTunes or Outlook. It's not possible. This is a seriou bug
    I've really tried  all suggestions found in this bolg, but in vain.
    Can someone from Apple help me to fix this bug please?

    Hi guys, thanks for your responses.
    What is this vboxnetflt for? Which modules are the essential modules for virtualbox? What I mean is: do those nice features like mouse point integration, full screen supportment etc... rely on vboxnetflt and vboxnetadp?
    What I have in my configuration file is:
    MOD_AUTOLOAD="yes"
    #MOD_BLACKLIST=() #deprecated
    MODULES=(vboxdrv vboxnetflt vboxnetadp)
    I think vboxnetadp is used for networkiing. and vboxnetflt sounds like network filtering stuff. Can someone please confirm me? I think the problem was the sequence of upgrading. Firstly it updated the kernel and then installed the new version of virtualbox. I think if it could install the new version of virtualbox first and then the kernel, it would go without any problem, just my opinion as I said.
    Let's keep tracked on this. Maybe someone will find a solution before virtualbox developers :-)

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

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

  • Please help me  to find link between customer and Business partner

    Hi All,
    With the help of customer number as input for my report, i have to find the Business partner.
    Please help me how  to find the Business partner based on the customer number using tables.

    hi,
    Get the customer address number from the KNA1 table
    and pass that to the FM ADDR_GET with address group as BP( business partner)
    you get the Business partner address number and from that you can find the business partner number from KNA1 table
    or in KNVP table field KUNN2 gives the BP number
      DATA: w_selection_ds     TYPE  addr1_sel,
            w_addrprnt_ds      TYPE  adrs_print,
            w_adrs1_ds         TYPE  adrs1.
      clear w_address_value_ds.
      w_selection_ds-addrnumber = w_kna1_ds-adrnr.  "address number
      CALL FUNCTION 'ADDR_GET'
        EXPORTING
          address_selection = w_selection_ds
          address_group     = 'BP'         "business partner
        IMPORTING
          address_value     = w_address_value_ds
        EXCEPTIONS
          address_not_exist = 1
          OTHERS            = 2.
    regards
    Prasanth

  • HT5624 I have 2 IPhones (personal and business) and an IPAD - and my Apple ID needs to be different for the personal and busines phones - i've had to change my password so many times it's a mess can someone help me?

    I have 2 Iphone (personal and business) and an IPad for business.  I've setup my apple Id's the business IPhone and IPad and a different Apple ID for personal phone - and my IPhones keep asking me for the Apple ID on both phones ...

    Im gona ask some questions but do not post your Apple ID's.
    Do you use the same account for iCloud on all devices?
    Do you have the same account signed in at settings>itunes & app store on all devices or are they seperate?
    Do you have the same apple id signed in with imessage or facetime on all devices or seperate?
    Yes or no will be fine with seperate or same added just to get a fair idea of what we are dealing with and do us fellow userd will do our best to help you out.

Maybe you are looking for

  • Auto Creation of DSV via Views

    we are trying to create a DSV using sql server database Views. after completing all steps in using Wizard  we found that the diagram has no relationships. All the views are independent. Although in source database the views have no relation but the c

  • How can I get the infoset name by giving the name of a program of a query?

    How can I get the infoset name by giving the name of a program of a SAP Query? Regards, Subho

  • Xpath expression to read contents

    requesting to help to write an xpath expression to read contents of the below xml. i/p doc <transaction tid='00000000000000001852' ts='2012-05-10 08:43:15.000631' ops='2' commitTs='2012-05-10 08:43:15.000631'> <operation table='INTEREST_ACCRUAL_TERMS

  • Why does office for Mac keep asking for passwords?

    Very frustrating!! Not only can I sync Outlook for Mac with my i-phone contacts, Mail & Calandar, but it also keeps asking for email passwords. this now means the gmail accounts outlook for Mac is connecting to has kicked me out because too manny sig

  • Executed CheckFlightSeatAvailability error

    hi, When i executed the sample CheckFlightSeatAvailability(Proxy_2_Proxy)which was took along by xi.there arose a mistake:"HTTP response contains status code 401 with the description Unauthorized "    Can anybody tell me the reason which resulted it?