By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,034 Members | 822 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,034 IT Pros & Developers. It's quick & easy.

Why not only one interface for a EJB ??

P: n/a
Hi,
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??

Thanking you in Advance
Have a nice day
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Amardeep,

I was about to ask the same question. I have always wondered what a
developer can achieve by writing EJB's. I wrote javabeans etc,but not
extensively.
I am primarily a database pro for the past 9 years. trying to get a hang of
java related technologies.
any response,
thanks,

"Amardeep Verma" <ad******@email.com> wrote in message
news:1a*************************@posting.google.co m...
Hi,
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??

Thanking you in Advance
Have a nice day

Jul 17 '05 #2

P: n/a
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)
Jul 17 '05 #3

P: n/a
Hi,
But if the developer had only one interface, would that not make
his/her task easier? I agree there is a sepration of tasks between the
Container and the Developer, But that is hardly the reason why there
should be two interfaces. Why cant one interface handle both the
tasks? What was the need for sepration?
Have a nice day
"Martin Kersten" <Ma************@student.uni-magdeburg.de> wrote in message news:<bp**********@graf.cs.uni-magdeburg.de>...
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)

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.