File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes When To Use Entity Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "When To Use Entity Beans" Watch "When To Use Entity Beans" New topic

When To Use Entity Beans

sachin sachdeva

Joined: Mar 13, 2001
Posts: 14
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.
Jim Baiter
Ranch Hand

Joined: Jan 05, 2001
Posts: 532
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.
I agree. Here's the link:
subject: When To Use Entity Beans
jQuery in Action, 3rd edition