Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

why we implement session bean or entity bean  RSS feed

 
muthukumaran mohan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I have a simple doubt. Why we implement session bean or entity bean in Enterprice bean class. Actually we have to implement remote interface know, so that the method present in remote interface will be given definition. please clear my doubt.
with regards
thanx in advance
muthukumaran
 
Jorge Phillips
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All EJB's are accessed through interfaces (remote in 1.1, remote or local in 2.0).
Session beans provide functional or stateful process modeling and exist only throughout the client's session. Entity beans, on the other hand, are used for data modeling and provide persistent data and well mapping to persistent storage (relational DB, object DB). Entity bean extent or scope does not depend on the client's session extent.

So, if you are modeling process and don't need bean state (functional) or need only session-lived state, use a session bean (stateless or stateful, respectively). Otherwise if you are modeling data and need persistent state and want it mapped to a data store use an entity bean.
Hope this helps to clarify your issue.
 
vintu79
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
muthu i think u a bit confused by looking into RMI and EJB
on RMI our implemetation class as to implement the remote interface that we are using.in the case of EJB we are not doing so because the Implementation class are written are by the container automatically. ie during the time of deployment the container will generate you the implementaion class you can open the implementation class code and see you will find your remote interface implemented there.In weblogic during deployment you will get bean class with Impl you can check that for clarifications.while deploying EJB in weblogic you select keep code generated option this will give you the java file for the class that are created.

Originally posted by muthukumaran mohan:
Dear All,
I have a simple doubt. Why we implement session bean or entity bean in Enterprice bean class. Actually we have to implement remote interface know, so that the method present in remote interface will be given definition. please clear my doubt.
with regards
thanx in advance
muthukumaran

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!