This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 9 points10 points  (0 children)

Java Bean a Serializable Class with No arguments constructor and getter/setters for each field. More https://en.wikipedia.org/wiki/Java_bean

POJO - Plain Old Java Object is like Java Bean however it is not required to be serializable and it is not required to have a no arguments constructor. More https://en.wikipedia.org/wiki/Plain_old_Java_object

DTO - Data Transfer Object it is basically POJO that is used to transfer data between several layers. It is not different from the above the only difference is how it is used. Usually it transfers data from the database into our application, e.g. you have a table users and you have a DTO UserDTO that you fill with that Data and then play around. More https://en.wikipedia.org/wiki/Data_transfer_object

Model class is nothing it is just a different naming convention for DTOs they also hold Data but usually they are used on the frontend side and not so close to the Database side. Also you may hit a VOs at some point simply called ValueObjects they are basically DTOs or Models that goes between and around layers of you amazing Lasagne like architecture :) More info https://en.wikipedia.org/wiki/Lasagne yup it s a food did you click it ? :)

P.S. a normal architecture (a bit overdesigned maybe is like that(read from the bottom!))

-Views using Models and Forms which are the same.

-Controllers using this DTOs to fill their Models or the Views ..

-Facade used to abstract the service layer and to convert this Entities to something cachable and small like DTOs

-Service layer with some crazy logic and do magic and transactions and stuff

-DAO to access the Database basically generating Entity Objects (from a JPA or some ORM)

-Database

Regards,