当前位置:网站首页>Object partition

Object partition

2022-06-21 23:59:00 Hoh Xil's flight

Reproduced in :http://www.hollischuang.com/archives/553

PO(persistant object) Persistent object

stay o/r The concept that appears when mapping , without o/r mapping , There is no such concept . It usually corresponds to the data model ( database ), It also has some business logic processing . It can be seen as mapping to tables in the database java object . The simplest PO It is a record in a table corresponding to the database , Multiple records can be used PO Set . PO There should be no database operations in the .

DO(Domain Object) Domain object

A tangible or intangible business entity abstracted from the real world .
It generally corresponds to the table structure in the data .

TO(Transfer Object) , Data transmission object
Different in applications tie( Relationship ) Between objects
Entities sent between microservices

DTO(Data Transfer Object) Data transmission object
This concept comes from J2EE Design mode of , The original purpose was to EJB Distributed applications provide coarse-grained data entities , To reduce the number of distributed calls , This improves the performance of distributed calls and reduces network load , But here, , I refer generally to the data transfer objects used between the presentation layer and the service layer .

VO(view object) The value object
View objects , For display layer , Its function is to put a specified page ( Or component ) All the data of .

BO(business object) The business object
From a business model perspective , see UML Domain objects in component domain model . Encapsulating business logic java object , By calling DAO Method , combination PO,VO Conduct business operations . business object: The business object The main function is to encapsulate the business logic as an object . This object can include one or more other objects . Like a resume , Have educational experience 、 Work experience 、 Social relations and so on . We can match educational experience with PO , Work experience corresponds to a PO , Social relations correspond to one PO . Create a resume for BO Object processing resume , Every BO Contains the PO . When doing business logic like this , We can aim at BO To deal with .

POJO(plain ordinary java object) Simple and irregular java object
In a purely traditional sense java object . That is to say, in some Object/Relation Mapping In the tools , Be able to maintain database table records persisent object It's exactly a match for Java Bean Normative purity Java object , No other attributes or methods have been added . My understanding is the most basic Java Bean , Only attribute fields and setter and getter Method !.

DAO(data access object) Data access object
It's a sun A standard of j2ee Design patterns , There is an interface in this pattern that is DAO , It negates the operation of persistence layer . Provide interfaces for the business layer . This object is used to access the database . Usually and PO Use a combination of , DAO Contains a variety of database operations . By its way , combination PO Related operations on the database . Sandwiched between business logic and database resources . coordination VO, Providing the database CRUD operation

原网站

版权声明
本文为[Hoh Xil's flight]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206212210308925.html