filmov
tv
Differences - POJO vs Bean vs Entity vs DTO/VO vs Model vs Domain Class | Java Tutorial
Показать описание
Differences among POJO vs Bean vs DTO/VO vs Model vs Domain Class | Deep Drive into practical knowledge :
if you like my video, please subscribe to my channel and share the video
Instagram: techtalk_debu
Pojo :::
POJO is an acronym for Plain Old Java Object. The name is used to emphasize that the object in question is an ordinary Java Object, not a special object.
Should -
1. Class public
2. private data members
3. getter and setters method
4. No arg or Default Constructor
They were introduced in EJB 3.0 by Sun microsystems.
A POJO should not:
Beans
--------
Beans are special type of Pojos. There are some restrictions on POJO to be a bean.
All JavaBeans are POJOs but not all POJOs are JavaBeans.
Serializable i.e. they should implement Serializable interface. Still some POJOs who don’t implement Serializable interface are called POJOs beacause Serializable is a marker interface and therefore not of much burden.
Value Object/VO
--------------
DTO
--------------
Instead of performing many remote calls on EJBs, the idea was to encapsulate data in a value object that could be transferred over the network: a Data Transfer Object.
Model
-------
The 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.
Domain
-------
Your main Business classes, nothing but a POJO class.
Thanks & Regards,
Debu Paul
if you like my video, please subscribe to my channel and share the video
Instagram: techtalk_debu
Pojo :::
POJO is an acronym for Plain Old Java Object. The name is used to emphasize that the object in question is an ordinary Java Object, not a special object.
Should -
1. Class public
2. private data members
3. getter and setters method
4. No arg or Default Constructor
They were introduced in EJB 3.0 by Sun microsystems.
A POJO should not:
Beans
--------
Beans are special type of Pojos. There are some restrictions on POJO to be a bean.
All JavaBeans are POJOs but not all POJOs are JavaBeans.
Serializable i.e. they should implement Serializable interface. Still some POJOs who don’t implement Serializable interface are called POJOs beacause Serializable is a marker interface and therefore not of much burden.
Value Object/VO
--------------
DTO
--------------
Instead of performing many remote calls on EJBs, the idea was to encapsulate data in a value object that could be transferred over the network: a Data Transfer Object.
Model
-------
The 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.
Domain
-------
Your main Business classes, nothing but a POJO class.
Thanks & Regards,
Debu Paul
Комментарии