Re: Why not only one interface for a EJB ??

From: Martin Kersten (Martin.Kersten_at_student.uni-magdeburg.de)
Date: 11/25/03


Date: Tue, 25 Nov 2003 07:23:06 +0100

Hi Amardeep,

> As you know there are two interfaces, home and component interface
> to a EJB Bean. But why are there two interfaces? Why not have only one
> interface which will do the work of both? What is the advantage of two
> interfaces?
>
> Anybody can shed light on this topic??

It's like the factory pattern I guess. You can use a Factory to create and
find instances. It simply seperates the Bean instance/interface and its
factory/pool instance/interface. Also the interfaces classes are created
and manipulated by the J2EE container. Therefore I guess its really a
logical and usefull seperation. I also believe it's a common pattern for
the good old CORBA programming.

I like it this way ;)

Martin (Kersten)



Relevant Pages

  • Re: Why not only one interface for a EJB ??
    ... > to a EJB Bean. ... But why are there two interfaces? ... It's like the factory pattern I guess. ... It simply seperates the Bean instance/interface and its ...
    (comp.lang.java.developer)
  • Re: Why not only one interface for a EJB ??
    ... > to a EJB Bean. ... But why are there two interfaces? ... It's like the factory pattern I guess. ... It simply seperates the Bean instance/interface and its ...
    (comp.lang.java.programmer)
  • Re: Why not only one interface for a EJB ??
    ... > As you know there are two interfaces, home and component interface ... > to a EJB Bean. ... But why are there two interfaces? ... map to class methods. ...
    (comp.lang.java.programmer)
  • Why not only one interface for a EJB ??
    ... As you know there are two interfaces, home and component interface ... to a EJB Bean. ... Thanking you in Advance ...
    (comp.lang.java)
  • Why not only one interface for a EJB ??
    ... As you know there are two interfaces, home and component interface ... to a EJB Bean. ... Thanking you in Advance ...
    (comp.lang.java.developer)