• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When To Use Entity Beans

 
sachin sachdeva
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all
I want to know that in which case we need to opt for Entity Beans.Like in the books it is given the example of Banking Applications but i need some more practical and satisfactory answer.
Thanx
 
Jim Baiter
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best source is the J2EE blueprint. Basically they state that an entity bean is a coarse-grained representation of a database record. So the entity bean should represent data whereas the session bean would represent behaviour. Haefel's book has a good example where the Cabin is an entity bean because the Cabin just represents a cabin on a cruise ship with a location, size, etc.
The TravelAgent is a session bean because the travel agent books passage for customers and is behaviour-oriented. It basically boils down to an MVC sort of pattern.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic