Vo, DTO, dao--in Java

Source: Internet
Author: User

Original address: http://yinchunjian.iteye.com/blog/758196

O is a mapping to a table in the database, a table corresponding to a VO
DAO is to use VO to access the real table, the operation of the database is done in DAO
Bo is the business layer that does the logical processing

VO, PO, BO, QO, DAO, POJO,

The O/R Mapping is an Object relational
An abbreviation for the Mapping (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 O/R
In the world of Mapping, there are two basic and important things to understand, namely VO, PO.

VO, the Value object,

PO, Persistent object (persisent
Object), which consists of a set of properties and properties of the get and set methods. Structurally, they are nothing different. But it is completely different from its meaning and nature.
1. VO is created with the New keyword and collected by the GC.
The PO is created when new data is added to the database, and the data in the database is deleted. And it can only survive in a database connection, and the disconnection is destroyed.
2. VO is a value object, the precise point is that it is a business object, is living in the business layer, is used by business logic, it is the purpose of survival is to provide a place for the data to survive.
The PO is stateful, and each property represents its current state. It is the object representation of the physical data. Using it, we can decouple our programs from physical data and simplify the transformation between the object data and the physical data.
3. VO's properties are different depending on the current business, that is, each of its properties corresponds to the name of the data needed for the current business logic.
The properties of the PO correspond to the field one by one of the database table.
The PO object needs to implement the serialization interface.
-------------------------------------------------

Java's (Po,vo,to,bo,dao,pojo) explanation
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, 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. Individuals feel the same DTO (data transfer object) that is passed on the web.
to (Transfer object), data transfer object
Objects that are transferred between different tie (relationships) in the application
BO (business object) service object
From the business model perspective, see the domain objects in the UML component Domain model. A Java object that encapsulates the business logic, by invoking the DAO method and combining PO,VO for business operations.
Business object: Operational objects
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, education experience, work experience, social relations and so on.
We can have an education experience corresponding to a PO, work experience corresponding to a PO, social relations corresponding to a PO.
Create a CV-based Bo object to process resumes, each Bo containing these PO.
When we handle business logic like this, we can deal with BO.
QO: Querying objects
POJO (Plain ordinary Java object) simple, rule-free Java objects
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 CRUD operations for the database ...

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. Through these mappings, this O/R
Mapper can generate all the SQL statements about object Save, delete, read, we no longer need to write so many lines of DAL code.
Entity model (solid mode)
DAL (data access Layer)
Idal (interface layer)
Dalfactory (class factory)
BLL (business logic Layer)
BOF business Object Framework service objects Frame
SOA Service Orient Architecture Services-oriented design
EMF Eclipse Model Framework
Eclipse Modeling Framework

Vo, DTO, dao--in Java

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.