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 O’Reilly online learning.

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