Several objects in Java (Po,dto,dao, etc.)

Source: Internet
Author: User

In the

Java EE, it is often mentioned that several objects (object), understanding their meanings can help us to better understand the object-oriented design thinking. &NBSP
    pojo (plain old Java object): Ordinary Java objects, distinct from special Java objects (including inheritance constraints, etc.) and EJBS. Pojo generally only has a series of properties and corresponding get, set methods.  
    po (Persistant object): Persisted objects, different from Pojo, must correspond to entities in the database. A record for a PO corresponding database. The life cycle of a persisted object is closely related to the database and can only exist in connection, and the PO disappears when the connection is closed.  
    Po has many differences over Pojo, such as the properties and methods that hold the database entity state in the PO. But ORM (object-relation mapping) pursues the goal is the PO and pojo consistent, so in the programmer's Daily development, is to use Pojo as a PO, and pojo into the PO function to the framework of hibernate and so on. &NBSP
    dto (Data Transfer object): Data Transfer object, formerly known as a Value object (Vo,value object), The only function is to transfer data between the subsystems of the application and display it at the presentation level. Unlike Pojo, a dto does not correspond to an entity, it may store only some of the attributes of the entity or join other properties that meet the transport requirements.  
    dao (Data Access Object): Access objects. Provides an abstract interface to access the database, or a persistence mechanism without exposing the internal details of the database. DAO provides a match from the program call to the persistence layer.  
    bo: Business object. The main focus is to encapsulate business logic as an object that can contain one or more other objects. For example, "Principal" (principal), has "Name", "age" and other attributes, and "employee" (employee) has a 1-to-many relationship, this "Principal" can be used as a business-related 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.

Do (domain object) domain objects

is a tangible or intangible business entity that is abstracted from the real world. In general, the table structure in the data corresponds.

to (Transfer object), data transfer object

Objects that are transferred between different tie (relationships) in the application

DTO (Data Transfer object) data transfer objects

This concept derives from the design pattern of the Java EE, which was originally designed to provide coarse-grained data entities to the distributed application of EJBS to reduce the number of distributed calls, thereby improving the performance of distributed calls and reducing network load, but here I refer to the data transfer objects between the presentation layer and the service layer.

VO (View object) Value Object

A View object, used for the presentation layer, that encapsulates all the data for a specified page (or component).

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: The primary role of the operational objects 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.

POJO (Plain ordinary Java object) simple, rule-free Java objects

Java objects that are purely traditional in meaning. In some object/relation Mapping tools, the Persisent object that maintains database table records 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, provides a CRUD operation of the database

https://www.zhihu.com/question/39651928

Several objects in Java (Po,dto,dao, etc.)

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.