Only 49 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Combining Home and Remote interfaces in EJB  RSS feed

 
Surender Goyat
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi... Can we combine home and remote interfaces into one.
Can u please justify your answer.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In EJB Specification can not combine home and remote interfaces into one file.
 
Surender Goyat
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats the reason....
means why we can't do it..
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even if I couldn't find a reference against doing this, I think the object lifecycle will be the stuff that will raise problems. Try takeing a look at the lifecycle of the objects involved in a J2EE architecture and I think you will see the possible issues against doing.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Home interface is used to create the EJB Object and pass this reference to the client (caller).

The Component interface is used to define the business logic (methods) that are provided by the EJB that linked up with the EJB Object.

Can you imagine that, the EJB object creates itself from non-existing, and then send itself to you as the reference, and provide you the services?

Nick
 
Mo Gupta
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J2EE designs EJBHome and EJBObject as two different network objects.
When EJBHome is located on server it actually communicates through RMI-IIOP and follows Stub - Skeleton Arch similarly for EJBObjects. So this clears containers might use existing resources from its pool and that helps in performances of trx. If it is merged together imagine the overhead it has to bear to modify layers of commn, dowloads on both ends, and next network request.
- Manoj.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Home interface is used to create the EJB Object and pass this reference to the client (caller).

The Component interface is used to define the business logic (methods) that are provided by the EJB that linked up with the EJB Object.

Can you imagine that, the EJB object creates itself from non-existing, and then send itself to you as the reference, and provide you the services?


10x Nick for detailing a little bit my thoughts (time was pressing me :-) ).
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!