• Post Reply Bookmark Topic Watch Topic
  • New Topic

About J2EE Architecture  RSS feed

 
Navin Pillu
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I've query about J2EE Architecture. Could anybody explain me purpose of home & remote interfaces in J2EE architecture. I know Home inteface defines create & finder method and remote defines business logic. But ultimately we combine it into EntityBean (Except finder). Then what is the purpose of creating 3 things instead of 1
This might be a foolish question, bcoz i'm new to EJB. Plz explore it.

Thanks in Advance
 
Sushil Deshpande
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Navin Pillu:
Hi All

I've query about J2EE Architecture. Could anybody explain me purpose of home & remote interfaces in J2EE architecture. I know Home inteface defines create & finder method and remote defines business logic. But ultimately we combine it into EntityBean (Except finder). Then what is the purpose of creating 3 things instead of 1
This might be a foolish question, bcoz i'm new to EJB. Plz explore it.

Thanks in Advance




Hello Navin Pillu
Its a Good Question.Tha Most important abt EJB Architecture is that it will based on the RMI Architecture.
Since there are two interface designed in EJb one is home and one is Remote.
You can;t access the Home methods remotely.Methods defined only in the Remote(Business) interface expose methods that is accessible by the Client.
And since this interface is used to generate the EJB object at runtime in container specific algorithms,the vendor can impose their own algo to the Interfaces so that some platfom services can be easily accessed.
In home interface there are some business methods that is accessible internally and might contain secret business logic which you don't want to exposed to the client by Remote Interfaces.

I will post some new Info asap.



Thanks and Regards,
Sushil Deshpande
FWL Technologies India Pvt. Ltd.,
Cell: 9822251993.
Tel.:91-020-25818096/97 ext:310.
E-Mail: sushil.deshpande@fwltech.co.in
http://www.fwltech.com
"If you don�t know the destination, then it�s just useless to read the roadmap"
 
Navin Pillu
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sushil

Thanks for prompt reply. But what i think is that we can combine these two things in single interface also. I mean one interface & one entity bean class are sufficient. Then why two interfaces are needed

Thanks in Advance
:roll:
 
Sushil Deshpande
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya You can.
But in real Enterprise world,EB can not be accessed directly.Most of J2ee architecture uses the Session facade patterns in which you can directly call the methods on the Home interface.
But Still if you want security you have to Implement the Remote Interface.


See design Patterns on java.sun.com

Since EJb Follows the RMI Semantics,After locating the Home Interface via JNDI,and then executing the Create or finder methods the Home Interface returns the primary key class which is first interpreted by the container and then container returns the Remote Interface to you so that you can locate the EJB by calling methods on it.If I do not want to expose the Create methods to client so i do not write it into the Remote Interface.

You must notice that Home interface returns Primary key class but actual bean class returns the null,so EJb object behaviour can be easily change by Container by providing the Two different Interfaces.


You should read the "Mastering EJB" by Ed Roman on theserverside.com.Its a downloadable PDF...........
....................
Its sufficient to read the first 3 chapters...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!