Generating Data Transfer Objects (DTO)

The data transfer object (DTO) design pattern provides better maintainability by separating usecases from the object model, allows for reuse of entity beans across different applications, and increases performance when the attributes from multiple entity beans can be passed to the client with a single call.

To generate data transfer objects:

  1. In the Navigator, select an entity bean.
  2. Right click and choose Generate then choose Data Transfer Object.
    A new file,
    <entity_name>LocalDTO.java, appears in the Navigator.
  3. Open this file in the Java Code Editor and uncomment the line that starts:
    // _load....

 


Related topics

About J2EE Design Patterns
Implementing Business Logic