15.6. Using value objects with EJBs

Although the entity EJB developer can provide business methods to get and set all the persistent instance variables of the entity EJB, in many cases a client will want to get or set all these attributes in one operation. Because all method calls between EJBs can involve a network operation (except with a local client view— see below), it is becoming standard practice to provide methods that pass all the instance variables in one operation, wrapped inside a utility class. The utility class is usually called a value object, [3] but the term data model class is also sometimes used.

[3] The term ‘value object’ is—rather confusingly—used in the EJB Specification to mean something slightly different: any object that ...

Get Applied Enterprise JavaBeans™ Technology 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.