Тёмный

Differences - POJO vs Bean vs Entity vs DTO/VO vs Model vs Domain Class | Java Tutorial 

TechTalk Debu
Подписаться 11 тыс.
Просмотров 17 тыс.
50% 1

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
Follow me on FaceBook: / techtalkdebu
Github Code Link : github.com/adm...
Instagram: techtalk_debu
and LinkedIn: / debu-paul
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:
Extend prespecified classes, Ex: public class GFG extends javax.servlet.http.HttpServlet { … } is not a POJO class.
Implement prespecified interfaces, Ex: public class Bar implements javax.ejb.EntityBean { … } is not a POJO class.
Contain prespecified annotations, Ex: @javax.persistence.Entity public class Baz { … } is not a POJO class.
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
--------------
A Value Object or VO is an object such as java.lang.Integer that hold values (hence value objects).
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

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 27   
Далее
Это было очень близко...
00:10
Просмотров 940 тыс.
Grand Final | IEM RIO 2024 | BO5 | КРNВОЙ ЭФИР
6:35:24
5 Rules For DTOs
17:56
Просмотров 43 тыс.
Use DTO instead of Model and Entity objects
8:11
Просмотров 22 тыс.
JAVA DTO Pattern Tutorial | Simplify Your Code
19:12
Просмотров 207 тыс.
Why use DTOs (Data Transfer Objects)?
7:23
Просмотров 73 тыс.