Creating the Session Bean

There are different schools of thought on whether a client application should be able to access entity beans. Obviously, from a technical perspective, a client might access entity beans—this is more of a design issue. When a client uses the entity beans directly, there is danger that common business logic will move onto the client application making the application harder to maintain. As a general rule of thumb, it's better to have the clients go through session beans to access entity beans.

Some developers question the need for entity beans at all if the client only uses session beans. Although some developers might enjoy writing tedious SQL code, most prefer to concentrate on the real business problems. Entity beans, ...

Get Special Edition Using Java™ 2 Enterprise Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.