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)

Related Article

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.