Persistant Object PO

This concept arose with ORM and can be thought of as a Java object that maps to a table in a database. Usually a record in a table in the corresponding database. PO is only used to represent data without any data manipulation. Usually follow the Java Bean specification and have getter/setter methods.

  • The life cycle of a PO: It is created when new data is added to the database and deleted when data is deleted from the database. It can only survive a single database connection and is destroyed upon disconnection.
  • What PO does: It can treat a record in a data table as an object, which can be easily converted to other objects. PO is stateful, with each attribute representing its current state. Using it, we can decouple our programs from physical data and simplify the conversion between object data and physical data.
  • The characteristics of the PO:
    • The ATTRIBUTES of the PO correspond one-to-one to the fields of the database table
    • PO objects need to implement serialization interfaces
    • A POJO is persisted as a PO

BO (Business Object – Business Object)

BO is used to represent a business object, which contains business logic, often encapsulates calls to DAO, RPC, etc., and can be converted from PO to VO/DTO.

BO is usually located in the business layer and is distinguished from the service layer that provides services directly: BO provides the basic business operations of the basic business unit and is designed to be an object invoked by the service layer business process. A business process may need to invoke multiple BO’s to complete.

DO (Domain Object – Domain Object)

Domain objects are tangible or intangible business entities abstracted from the real world. Usually in the business layer.

VO (Value Object/View Object – Value Object/View Object)

Value objects, also known as business objects, live in the business layer and are used by business logic. Their purpose is to provide a place for data to live (actually similar to DO).

VO attributes are different according to the current business, that is, each of its attributes corresponds to the name of the data required by the current business logic.

VO is typically used for data transfer between business tiers and contains only data. But it should be an abstract business object. Depending on service requirements, it can correspond to a table or not. Created with the new keyword and collected by GC.


View Object, used in the presentation layer, encapsulates all the data of a given page (or component), corresponding to the value of the entire interface

DTO (Data Transfer Object)

The concept of DTO is derived from the J2EE design pattern. The original purpose of DTO is to provide coarse-grained data entities for the distributed application of EJB, so as to reduce the number of distributed calls, thus improving the performance of distributed calls and reducing network load.

A DTO is used to represent a data transfer object and is usually used to transfer data between different services or different layers of services.

DTO is similar to VO, but there are some differences, mainly in the design concept, for example, THE API service needs to use DTO, while the presentation layer page uses VO. For example, VO stores male and female for gender purposes, while DTO stores codes such as 1 or 2.

DAO (Data Access Object – Data Access Object)

DAO is a standard J2EE design pattern from SUN. One of the interfaces in this pattern is DAO, which is responsible for the operation of the persistence layer and provides the interface to the business layer. This object is used to access the database. Usually used in combination with PO.

The DAO contains various database operations. Through its methods combined with PO to perform CRUD operations on the database.

Pojos (Plain Ordinary Java Object)

A POJO represents a simple Java object. PO, VO, and DTO are typical POJOs.