• Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity & Session Bean in one EJB ???

 
HASAN SIF
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we use both Entity Bean and Session Bean both in a single EJB class.
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it would be sensible not to attempt to combine them, even if it was possible. Each has a different emphasis and a different role to play. Try to see an EJB as either one or the other, not both.
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the other hand there's no reason why you shouldn't access both Entity Beans and Session Beans from a particular class.
Alternatively, one can hide the other, ie. you could design the session bean so that it provides one point of access for the client, and the session bean would perform all the interaction with entity beans 'behind the scenes'.
I think it makes sense not to expose the data layer to all and sundry where updating of the data is concerned.
[This message has been edited by George Brown (edited November 10, 2000).]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!