Several objects in Java (Po,vo,dao,bo,pojo)

Source: Internet
Author: User

One, PO:(persistant object), persistent objects

Can be seen as a Java object mapped to a table in the database. Using hibernate to generate a PO is a good choice.

Second, VO:(value object), Value objectsTypically used for data transfer between business tiers, as is the case with PO, which contains only data. But it should be abstracted out of business objects that can correspond to tables, or not, depending on the needs of the business.

PO can only be used in the data layer, VO used in the business logic layer and presentation layer. Each layer operation belongs to the layer's own data object, which can reduce the coupling between the layers, so as to facilitate the maintenance and expansion of the system later.

Third, DAO:(data access Objects), the object interface
DAO is the data Access object that is accessed by data access: As the name implies, dealing with the database. Sandwiched between business logic and database resources.

The Java EE developer uses the data Access object (DAO) design pattern to separate the underlying data access logic from the high-level business logic. Implementing the DAO pattern can be more focused on writing data access code.

DAO mode is one of the standard Java EE design patterns. Developers use this pattern to separate the underlying data access operations from the business logic on top. A typical DAO implementation has the following components:
1. A DAO factory class;
2. a DAO interface;
3. A specific class that implements the DAO interface;
4. Data passing objects (sometimes called value objects).
The specific DAO class contains the logic to access data from a specific data source.

Four, BO:(business object), operational objects Layer
All entity classes that represent "things" in the application realm. These entity classes reside on the server and take advantage of the service classes to assist in fulfilling their responsibilities.

V, POJO:(Plain old Java Objects), simple Java Object
The actual is ordinary JavaBeans, uses the Pojo name is to avoid and the EJB to confuse, and the abbreviation compares directly.
Some of these properties and their getter, setter method classes, can sometimes be used as value Object or DTO (Data Transform object). Of course, if you have a simple arithmetic property is also possible, but not allowed to have a business method, There is no way to carry a connection or something.

Several objects in Java (Po,vo,dao,bo,pojo)

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.