JavaEE PO VO BO DTO POJO DAO

The article is reprinted from https://www.cnblogs.com/java-class/p/5439646.html#_label5

 

        I admire people who can abstract complex and difficult technologies into simple and easy-to-understand things.

        Hate people who add a bunch of technical jargon to a simple and easy-to-understand technique and make others dizzy.

       PO VO BO DTO POJO DAO General overview:

1. DAO[data access object] data access object

  The DAO layer is a black box for developers, designed and encapsulated by architects.

  For a long time, I understood it as access to the database, followed by the accumulation of projects.

  I found myself with a relatively narrow understanding that access to data was more than just access to databases.

  If system A calls the services of system B to obtain data, the encapsulation of system A to access data objects of system B at this time can also be called DAO.

2. DTO[data transfer object] data transfer object

  Suppose there are 20 fields in the data table, but when the page displays the list, these 20 fields are obviously not used.

  I want to display 5 of these fields, and when these 5 fields are displayed, they are not their original appearance in the database.

  Calculation, interception, business code name transfer, etc. are also required.

  Therefore, the data transfer object was born. First, it can improve the speed of data transfer, and second, it can hide the back-end table structure.

3.PO[persistant object] persistence layer object

  There is a one-to-one correspondence between persistent object properties and fields in the database, and a piece of data in the database can be understood as a persistent object.

  Introduced into JavaEE project design due to the widespread use of ORM frameworks.

4.BO[business object] business object

  As the name suggests, a business object is an object abstracted from business processing. In addition to the get/set methods, there can also be methods for business processing of fields.

  Suppose you want to conduct business processing on a class, in which students, teachers, and even desks, chairs, and benches are part of the business object.

  Of course, the students, classrooms.... can all be POs corresponding to the database.

5.VO[value object] value object

  The value object can also be called a page object. If it is called a page object, it will represent the object of the entire page display layer.

  It can be converted from the conversion performed by the required business object.

  If you call it a value object, it can be understood as a place to store business objects.

  Assuming that the pots and pans are the corresponding business objects, the entire cupboard is a value object.

4.POJO[plain ordiary java object] simple java object

  Simple java objects should be the most flexible objects in the JavaEE world.

  In a simple system, it can be a DTO if it is a POJO from the database to the page display.

  If it is a POJO from the database to the business process, it can also be a BO.

  Also if the display from the database to the entire page, it can also be VO.

 

summary:

  The conversion between various data objects is quite flexible. All and several types of the above objects can be defined in the project, depending on the architect and requirements.

  In a large-scale project, the architect's task at the beginning of the project is not only to build the entire development environment, but also to define the data structure objects that flow in the system.

  This work requires the accumulation of many projects and long-term thinking on software development, more practice, more thinking, and providing the most suitable data object solutions, in order to show the charm of architects.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324406163&siteId=291194637