Difference between JAVA vo pojo javabean dto and pojojavabean

Source: Internet
Author: User

Difference between JAVA vo pojo javabean dto and pojojavabean

JavaBean is a reusable component written in JAVA. The class must be specific and public and have a non-parameter constructor. JavaBean exposes the member attributes of an internal domain by providing a public method that complies with the consistent design pattern. As we all know, attribute names comply with this pattern. Other Java classes can discover and operate these JavaBean attributes through their own mechanisms.

VO is the value object.
It is mainly reflected in the view object. For a WEB page, the attributes of the entire page are encapsulated into an object. Then, a VO object is used for transmission and exchange between the control layer and the view layer.

DTO (the processed PO may increase or decrease the PO attributes ):
Data Transfer Object
It is mainly used for remote calls and other places where a large number of objects need to be transferred.
For example, if a table has 100 fields, the corresponding PO has 100 attributes.
However, we only need to display 10 fields on the interface,
The client uses WEB service to obtain data. It is not necessary to pass the entire PO object to the client,
In this case, we can use DTO with only these 10 attributes to pass the results to the client, so that the server table structure will not be exposed. after the client is reached, if this object is used for display on the corresponding interface, then its identity will be changed to VO.

POJO (POJO is a concept or interface, and its identity and role change with the environment ):
POJO has some private parameters as the object attributes. Then, the get and set methods are defined for each parameter as the access interface.
Plain ordinary java object simple java object
POJO is a simple and common Java object that does not contain business logic or persistent logic, but is not a JavaBean or EntityBean, it does not have any special roles or classes or interfaces that do not inherit from or implement any other Java framework.
POJO objects are also known as Data objects and are widely applied to objects that represent reality.
After a POJO is persisted, it is a PO.
It is DTO in the process of passing and passing.
Directly used to correspond to the presentation layer is VO

JavaBean: JavaBean is a set of Java objects including the set and get methods.

 

POJO: A common Java object that implements the JavaBean standard for attributes. It can also contain some simple business logic (methods ).

 

PO: POJO is embodied in the persistence layer, and becomes a PO after POJO persistence. PO is more related to the database design level. Generally, a PO corresponds to a data table, and a PO is a record of the corresponding data table.

 

DAO: When PO is persisted to the database, it is necessary to perform related database operations (CRUQ). These database operation methods are uniformly put into a Java object, which is DAO.

 

BO: The embodiment of POJO in the business layer. for business operations, it is more about packaging objects from the business, such as a User's BO, which may include name, age, sex, privilege, group, etc. These attributes may be in multiple tables in the database, because each table corresponds to a PO, and our BO needs to combine these PO (or re-assemble) in order to become a complete object in the business.

 

VO (Value Object/View Object): the embodiment of POJO in the presentation layer. When we need to display the data, the POJO passed to the presentation layer becomes VO. It is used to display data.

 

DTO (Data Transfer Object): When POJO is transferred between systems. When we need to transmit data between two systems, one way is to serialize POJO and then pass it. The POJO in this transfer state is DTO.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.