In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what are the differences between VO, PO, DTO, DAO, BO and POJO". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what are the differences between VO, PO, DTO, DAO, BO and POJO?"
Java Bean: a reusable component, that is, "write once, execute anywhere, reuse anywhere". Meet three conditions
Classes must be concrete and public
With no parameter constructor
Public methods that provide consistent design patterns will internal domains or expose member properties
VO
Value object: value object
Typically used for data transfer between business tiers, created by new and recycled by GC
Like PO, it only contains data, but it should be an abstract business object, which can correspond to a table or not.
PO
Persistant object: persistence layer object
It is an one-to-one correspondence between the Entity,PO attribute in the ORM (Objevt Relational Mapping) framework and the fields of the table in the database. Corresponding to a record in a table in the database (that is, we can understand a record in the database table as a persistence layer object), multiple records can use a collection of PO, and the PO should not contain any operations on the database.
VO and PO are both get and set methods of attributes plus attributes; on the surface, there is no difference, but the meaning is completely different.
DTO
Data transfer object: data transfer object
It is a software application system for transferring data between design patterns. The goal of data transmission is often to retrieve data from the database by data access objects.
The difference between a data transfer object and a data interaction object or data access object is a data that does not have any behavior except for storage and retrieval (accesses and accessors)
In short, it is the encapsulation of data passed between interfaces.
There are more than a dozen fields in the table: id,name,gender (Mhammer F), age...
The page needs to display three fields: name,gender (male / female) and age
As a result, DTO can improve the speed of data transmission (reduce the transmission field) and hide the back-end table structure.
BO
Business object: business object
BO seals the business logic into an object and carries out business operations by calling the DAO method and combining PO or VO
PO combination, for example, the insured is a PO, the insured is a PO, the insurance information is a PO, and so on. Their combination is the BO of the first policy.
POJO
Plian ordinary java object: simple irregular java object
Pure traditional sense of java object, the most basic Java Bean only attributes plus attribute get and set methods
It can be converted into PO, DTO, VO;, such as POJO, which is DTO during transmission.
DAO
Data access object: data access object
It is an object-oriented database interface, which is responsible for the operation of the persistence layer and provides an interface for the business layer. It is mainly used to encapsulate the access to the database, and the common operation is nothing but CURD. We can also think that a DAO corresponds to an POJO object, which is located between the business logic and the database resources, and can be combined with PO to perform related operations on the database.
Others are model/module/domain/entity.
Entity
Entity, which is similar to PO in function, corresponds to data table one by one, one entity to one table.
Source: how to distinguish between vo, po, dto, bo, pojo, entity and mode?
At this point, I believe you have a deeper understanding of "what are the differences between VO, PO, DTO, DAO, BO and POJO". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.