Java Magazine, May/June 2018
ORACLE COM JAVAMAGAZINE MAY JUNE 2018 34 design patterns department0_ name as name2_ 0_ 0_ department0_ version as version3_ 0_ 0_ employees1_ department_ id as departme5_ 1_ 1_ employees1_ id as id1_ 1_ 1_ employees1_ id as id1_ 1_ 2_ employees1_ department_ id as departme5_ 1_ 2_ employees1_ firstName as firstNam2_ 1_ 2_ employees1_ lastName as lastName3_ 1_ 2_ employees1_ version as version4_ 1_ 2_ from Department department0_ left outer join Employee employees1_ on department0_ id employees1_ department_ id where department0_ id Data Transfer Object Pattern DTO is another well known and often used design pattern It introduces one or more classes to model a data structure employed by a specific use case or by the API of your application A DTO is a simple Java class that aims to transfer and provide access to its data in the most eficient way The following code snippet shows an example of the EmployeeWithDepartment DTO which stores the first name and last name of the employee and the name of the department public class EmployeeWithDepartment private String firstName private String lastName private String department public EmployeeWithDepartment String firstName String lastName
You must have JavaScript enabled to view digital editions.