Session Beans, Value Objects, and Data Access Objects

In this and in the sections that follow, we'll take a look at a session bean and an entity bean, and see how they both can be used for accessing information in a database. We'll also examine how other objects—value objects and data access objects—can help improve performance and reduce complexity.

Value Objects

One of the potential problems of using a remote object to perform database access is that EJBs often have getter and setter methods for each of their attributes. If these method calls are local, the overhead may be acceptable, but if it's over a network, this can generate a lot of network traffic. One way around this problem is to use a value object to encapsulate all the data and send ...

Get Java™ Oracle® Database Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.