The difference between JAVA vo Pojo JavaBean dtos

Source: Internet
Author: User

JavaBean is a reusable component written in the Java language. To write JavaBean, the class must be concrete and public, and have a parameterless constructor. JavaBean exposes the member properties to the internal domain by providing a public method that conforms to the consistent design pattern. It is well known that property names conform to this pattern, and other Java classes can discover and manipulate the properties of these javabean through their own mechanisms. 

Vo, which is the value object
The object that is primarily reflected in the view, for a Web page encapsulates the entire page's properties into an object. Then a Vo object is exchanged between the control layer and the view layer.

DTOs (processed po, may increase or decrease the properties of the PO):
data Transfer Object data transfer Objects
It is mainly used for remote calls, etc. where large quantities of objects need to be transferred.
For example, if we have 100 fields in a table, then the corresponding PO has 100 attributes.
but we just show 10 fields on the interface,
The client uses the Web service to get the data, and there is no need to pass the entire PO object to the client.
At this point we can pass the result to the client with a DTO with only these 10 attributes, so that the service-side table structure is not exposed. After the client arrives, if the object is used to display the interface, then its identity will be converted to VO.

POJO (POJO is a concept or interface in which identity and function change with the environment) :
Pojo has some private parameters as properties of the object. The Get and set methods are then defined for each parameter as an interface for access
Plain Ordinary Java object simple Java objects
that is, Pojo is a simple generic Java object that does not contain business logic or persistent logic, but is not javabean, Entitybean, etc., and does not have any special roles and classes or interfaces that do not inherit or implement any other Java framework.
Pojo objects are sometimes referred to as data objects, and are used in large numbers to represent objects in reality.
a Pojo is a PO after persistence.
It is the DTO that passes and passes directly through it .
directly used to correspond to the presentation layer is VO


JavaBean: First say Javabean,javabean is more of a specification, which is a Java object that contains a set of set and get methods.

POJO: Common Java objects, which generally implement the JavaBean standard for attributes, and can also contain some simple business logic (methods).

Po:pojo in the persistence layer of the embodiment of Pojo after the persistence of a PO. PO More is related to the database design level, the General PO and the data table corresponding to a PO is the corresponding data table a record.

Dao:po persisted to the database for the relevant database operations (CRUQ), these methods of database operations are uniformly placed in a Java object, which is DAO.

Bo:pojo in the business layer, for business operations, more is to wrap objects from the business, such as a user Bo, may include name, age, sex, privilege, group, etc., these properties in the database may be in more than one table, Because each table corresponds to a PO, our Bo needs the PO to be combined (or re-assembled) to become a complete object in the business.

VO (Value object/view Object): The embodiment of Pojo in the presentation layer. When we finish processing the data, we need to show, then the Pojo passed to the presentation layer becomes VO. It is used to show the data.

DTO (Data Transfer Object): Pojo when passed between systems. When we need to pass data between two systems, one way is to serialize the Pojo and pass it, the pojo of the passing state is the DTO.

The difference between JAVA vo Pojo JavaBean dtos

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.