Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comparing RMI and EJB

 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai all,
In RMI we call a Remote Method using our server programme and serve our client.why cannot the same be done in EJB. why do we need a Home interface to get an object for Remote interface. why can't it be done directly.
thanks
siva.
 
Amol Takate
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I know abt Home object is that :
Home Objects are introduced in EJB to have location transperency.
Home Objetcs are the factories of Remote objects, so that you can initialise a the beans in a different ways.
 
ahmad namini
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJB Home objects are not for location transparency, but rather a Factory for EJB Remote and Local Interfaces. This factory is implemented by the EJB container when returns the interface. The real beauty of the Home object is that the EJB container now controls the interception of client requests to the EJB and offers the client implicit middleware functionality (instance pooling, security, clustering, transactions, etc.)
So if choose not to use EJB's, you will need to provide all middleware services yourself. EJB's open standard and large vendor adoption makes it ideal for distributed systems.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic