Java's (Po,vo,to,bo,dao,pojo) explanation

Source: Internet
Author: User

Recently in the write interface to Android, where server data needs to define VO (Value object) object for encapsulation transport

For Vo, PO, BO, Qo,dao,pojo concept is still relatively vague, so here to record:

The O/R Mapping is an abbreviation for the Object Relational Mapping. The popular point is that the object is bound to the relational database, and the object is used to represent the relational data.

In the world of O/R Mapping, there are two basic and important things to understand, namely VO, PO.

PO (Persistant object) Persistent object
The concept that occurs at the O/R mapping, without the O/R mapping, does not exist. Usually the corresponding data model (database ), itself also has some business logic processing. Can be seen as a Java object mapped to a table in the database . The simplest Po is a record in a table in the corresponding database, and multiple records can be used with a collection of PO. The PO should not contain any operations on the database.

VO (Value object) value objects
Typically used for data transfer between business tiers, andPO also contains only data. But it should be an abstract business object., which corresponds to the table, or you can not, which is based on the needs of the business. Personally feel the sameDTO (Data Transfer Object), inDelivered on the web.

to (Transfer object), data transfer object
Different in the applicationTie (relationship) to transfer objects between

BO (business object) service object
From a business model perspective,  see  uml  the domain object in the component Domain model. Encapsulates the business logic of the  java  object  ,  by calling  dao   Method  ,  combined with  po,vo  for business operations.  
Business object:  service object  
The main role is to encapsulate the business logic as an object. This object can include one or more other objects.   such as a resume, with educational experience, work experience, social relations and so on.  
We can make an education experience corresponding to a  po  work experience corresponds to a  po .  
Create a CV  bo  object processing resumes, each  bo   contains these  po .  
This process of business logic, we can deal with  bo .  

QO: Querying objects

POJO (Plain ordinary Java object) simple, rule-free Java Object
Java objects that are purely traditional in meaning. Which means in some object/relation
Mapping tool to maintain the persisent of database table records
object is a pure Java object that conforms to the Java Bean specification and does not add other properties and methods. My understanding is the most basic Java Bean, only attribute fields and setter and getter Method!.

DAO (data Access object) Access objects
is a sun's standard Java EE design pattern, which has an interface that is DAO, which has negative persistence layer operations. Provides interfaces for the business layer. This object is used to access the database. Usually used in conjunction with PO, DAO contains various methods of operation of the database. Through its method, combine the PO to carry on the related operation to the database.

Sandwiched between business logic and database resources. With VO, provide database CRUD operations ...

Dto: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 reaching the client, if the object is used to display the corresponding interface, then its identity will be converted to VO

DAO: Data Access Object--also DAO mode
DTO: Data Transfer Object-also DTO mode

O/R Mapper object/relationship Mapping
After defining all the mapping, this O/R Mapper can help us do a lot of work. With these mappings, this O/R Mapper can generate all the SQL statements about object saving, deletion, and reading, and we no longer need to write so many lines of DAL (data access Layer) code.



Java's (Po,vo,to,bo,dao,pojo) explanation

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.