Java (PO, VO, TO, BO, DAO, POJO) Explanation

Source: Internet
Author: User


PO (persistant object) Persistent object
The concept that appears during o/r ing. If there is no o/r ing, this concept does not exist. Usually it corresponds to the data model (database), and some business logic is processed. It can be viewed as a java object mapped to a table in the database. The simplest PO is to correspond to a record in a table in the database. A set of PO can be used for multiple records. The PO should not contain any operations on the database.

VO (value object) value object
It is usually used for data transmission between business layers. Like PO, it only contains data. However, it should be an abstract business object, which can correspond to a table or not. This is based on the business needs. I personally think it is the same as DTO (data transmission object) and transmitted on the web.

TO (Transfer Object), a data transmission Object
Objects transmitted between different tie (LINKS) of an application

BO (business object) business object
From the business model perspective, see the domain objects in the UML component domain model. Java objects that encapsulate the business logic, and perform business operations by calling the DAO method and combining PO and VO.

POJO (plain ordinary java object) Simple and rule-free java object
Pure traditional java objects. In other words, in some Object/Relation Mapping tools, the persisent object that can maintain database table records is a pure Java Object that complies with Java Bean specifications, without adding other attributes and methods. My understanding is the most basic Java Bean, only the attribute fields and the setter and getter methods !.

DAO (data access object) data access object
Is a standard j2ee design mode of sun. There is an interface in this mode that is DAO, and its operation on the negative persistence layer. Provides interfaces for the business layer. This object is used to access the database. It is usually used in combination with PO. DAO contains various database operation methods. It combines PO with other methods to perform database operations. Stored in the middle of the business logic and database resources. Works with VO to provide database CRUD operations...

O/R Mapper object/relationship ing
After all mapping is defined, this O/R Mapper can help us do a lot of work. Through these mappings, this O/R Mapper can generate all SQL statements about saving, deleting, and reading objects. We no longer need to write so many lines of DAL code.

Entity Model)
DAL (data access layer)
IDAL (interface layer)
DALFactory)
BLL (business logic layer)
BOF Business Object Framework
SOA Service Orient Architecture Service-Oriented Design
EMF Eclipse Model Framework Eclipse modeling Framework

----------------------------------------

PO: full name is
Persistant object Persistent object
A po is a record in the database.
The advantage is that a record can be processed as an object, which can be easily converted to other objects.

BO: Full name:
Business object: business object
The main function is to encapsulate the business logic as an object. This object can include one or more other objects.
For example, a resume includes educational experience, work experience, social relationship, and so on.
We can correspond an educational experience to a PO, a work experience to a PO, and a social relationship to a PO.
Create a BO object to process the resume. Each BO contains the PO.
In this way, we can process the business logic for BO.

VO:
Value object
ViewObject presentation layer object
It mainly corresponds to the Data Objects displayed on the interface. For a WEB page, or a SWT or SWING interface, use a VO object to correspond to the value of the entire interface.

DTO:
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:
Plain ordinary java object simple java object
I personally think that POJO is the most common and variable object. It is an intermediate object and the most common object to deal.

After a POJO is persisted, it is the PO
It is DTO in the process of passing and passing.
Directly used to correspond to the presentation layer is VO

DAO:
Data access object
This person is the most familiar with it. It is the most different from the previous O, and there is basically no possibility or need to convert each other.
It is mainly used to encapsulate access to the database. With POJO, POJO can be persistently converted into PO, and PO can be assembled into VO and DTO.

-----------------------------------------------------------------

PO: persistant object Persistent object, which can be considered as a java object mapped to a table in the database. The simplest PO is to correspond to a record in a table in the database. A set of PO can be used for multiple records. The PO should not contain any database operations.

VO: value object. It is usually used for data transmission between business layers. Like PO, it only contains data. However, it should be an abstract business object, which can correspond to a table or not. This is based on the business needs. I personally think it is the same as DTO (data transmission object) and transmitted on the web.

DAO: data access object: the data access object used to access the database. It is usually used in combination with PO. DAO contains various database operation methods. It combines PO with other methods to perform database operations.

BO: business object. It encapsulates java objects of business logic. It calls DAO method and uses PO and VO to perform business operations;

POJO: plain ordinary java object is a simple and non-Rule java object. I personally think it and others are not at the same level. VO and PO should both belong to it.

---------------------------------------------
VO: Value Object and view object
PO: Persistent Object
QO: query object
DAO: Data Access Object
DTO: Data Transmission object
----------------------------------------
The ActionForm in struts is a VO;
The Entity bean in hibernate is a PO, also called POJO;
The Criteria in hibernate is equivalent to a QO;
When using hibernate, we will define some query methods. These methods can be written in interfaces and have different implementation classes. This interface can be called DAO.
I personally think that QO is similar to DTO.
----------------------------------------
PO is also called BO. The closest layer to the database is the o in the orm. It is basically an attribute corresponding to the database field in the BO. For the sake of synchronization and security, it is best to only call DAO or Service, instead of using packcode, backingBean, Or BO.
DAO, data access layer, put objects in VO and backingBean ....
DTO is rarely used. It is basically put into DAO, but serves as a transitional function.
QO puts some query operations and statements with durability ..
Basic elements and methods used in VO and V layers are included. If you want to call BO, you need to convert BO to VO and VO to BO. The advantage of VO is that its page has more element attributes than BO, which can play a very good role ....
-----------------------------------------
Wrong upstairs, PO is a persistent object. BO = business object-business object.
A po can correspond to a database table strictly, and a table is mapped to a PO.
BO is the object of business logic processing. My understanding is that it is full of business logic processing and is useful in complicated business logic applications.
VO: value object and view object
PO: Persistent Object
QO: query object
DAO: Data Access Object-there is also the DAO mode
DTO: Data Transmission object-also has the DTO Mode

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.