PO BO VO DTO POJO DAO concept and its role

Source: Internet
Author: User

PO BO VO DTO POJO DAO Concept and its role (with conversion chart) Blog Category:
    • Java
Javadaovopojobo

The large number of professional abbreviations in the development of the Java EE is confusing, especially for new graduates who are not clear-minded.  If with the company Daniel talk about technical people export is PO VO BO DTO POJO DAO, etc., so that the new people are extremely admired Daniel. In order to let the new people quickly become cattle, today I will introduce you in detail these professional terms.   Enterprise-level project combat (with source) address: http://zz563143188.iteye.com/blog/1825168 collect five years of development information:Http://pan.baidu.com/share/home?uk=4076915866&view=share PO (named bean,entity, etc.)
Persistant object Persistent objects, the display state of records in a database table in a Java object
The most vivid understanding is that a PO is a record in the database.
The advantage is that a record can be processed as an object and can be easily converted to other objects.


BO (named service,manager,business):The main function of business object is to encapsulate the business logic as an object. This object can include one or more other objects.
The image is described as the shape and action of an object, and of course there are some shapes and motions involving the object of the base. For example, dealing with a person's business logic, sleep, eat, work, work, and so on are also likely to be related to the shape of others.
When we handle business logic like this, we can deal with Bo.


VO (from the same notation):
Value Object Value objects
The object that is primarily reflected in the view, for a Web page encapsulates the entire page's properties into an object. Then a Vo object is exchanged between the control layer and the view layer.


DTOs (processed PO, may increase or decrease the properties of the PO):
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, and this will not expose the service-side table structure. After the client is reached, if the interface is displayed with this object, then its identity will be converted to VO.


POJO (POJO is a concept or interface in which identity and function change with the environment):Pojo has some private parameters as properties of the object. The Get and set methods are then defined for each parameter as access to the interface plain ordinary Java object simple Java objects i.e. Pojo is a simple plain Java object that does not contain business logic or persistent logic, but not JavaBean, Entitybean, and so on, does not have any special roles and classes or interfaces that do not inherit or implement any other Java framework.
Pojo objects are sometimes referred to as data objects, and are used in large numbers to represent objects in reality. A Pojo is a PO after persistence. Directly using it to pass, the process is the DTO directly used to correspond to the presentation layer is VO

DAO (Data Access object):This everyone is most familiar with, and the above several o the difference is the largest, the basic does not have the possibility and necessity of mutual transformation. Used primarily to encapsulate access to a database. It can be pojo to the PO, with PO assembled VO, DTO

controller control layer is mainly composed of Action/servlet (currently spring MVC is used by the @controller tag)This layer of business layer dealing with the view layer, responsible for transmitting the Vo object and call the Bo Layer business method, responsible for the view layer request data processing after the response to the view layer. view (views layer)Mainly refers to the jsp,html and other documents formed by the display layer. Summing up to use specific X0 need to see the specific environment and project structure, in different layers, different applications, the identity of the object is not the same, and the transformation of the identity of the object is also very natural. Just as you are a husband to your wife, you are a child to your parents. These concepts are designed not to bluff but to better understand and deal with the various logic, so that we can better to use object-oriented approach to deal with the problem.

In the normal development project, we must design each layer excessively, because this will bring a lot of work and repeat work. If you are not a large system, you can simplify some layers because the technology is service to the application.



Application of the above noun in the actual project example name (appellation-actual name) control layer (controller-action), Business Layer/Service layer (Bo-manager) entity layer (po-entity) DAO (DAO) View object (vo-this item omitted) view Layer (view-jsp/html)

PO BO VO DTO POJO DAO concept and its role

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.