Java terminology (PO/pojo/Vo/bo/Dao/DTO)

Source: Internet
Author: User

Po (persistant object) Persistent Object
The concept that appears during o/R ing does not exist if there is no o/R ing. usually it corresponds to the data model (database), and some business logic is processed. it can be seen as a Java object mapped to tables 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) 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, depending on the business needs. I personally think that the same DTO (data transmission object) is transmitted on the web.

Bo (Business Object) Business Object
From the business model perspective, refer to the domain objects in the UML component domain model. encapsulate Java objects in 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. that is to say, 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. In this mode, an interface is Dao, which is responsible for the operation of the persistent 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...

DTO (data transfer object) data transmission 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

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 Object Storage, deletion, and reading. We no longer need to write so many rows of dalCodeNow.
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

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/gaoyunpeng/archive/2008/02/14/2093211.aspx

 

 

 

A large number of professional acronyms in J2EE development are confusing, especially when discussing issues with some experts, they were dizzy by the technical terms in three minutes. Po VO Bo DTO pojo Dao, A lot of things are coming (friends who have heard of Lao Luo's criticism of this phenomenon will smile ).

First of all, I declare that I am not a master. The following summary is my own experience. For more information, see.

Po:
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:
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 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 Ava object
I personally think that pojo is the most 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.

To sum up, I think what is an object? O depends on the specific environment. In different layers and applications, the object identities are different, and the conversion of object identities is natural. Just like you are a husband to your wife and a child to your parents. The original intention of designing these concepts is not to expose people, but to better understand and process various logics, so that everyone can better deal with problems in an object-oriented way.

Do not be overly-designed. You do not have to design objects in code to distinguish them. In a word, the technology serves applications.

Thank you for your correction.

After drawing a picture, I feel that I have not completely expressed my meaning ..... Who can help improve the position of each o in MVC?

 

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.