Definition rules for entity classes

Article Directory

PO Entity

persisent object Persisent object
Sometimes called Data object, corresponding to the entity in the database, you can simply think that a PO corresponds to a record in the database

VO

The view project presentation layer object
mainly corresponds to the data object displayed on the page system (web page/swt/swing interface).
It can correspond to the table, or it can not correspond to the needs of the branch office

DTO(TO)

data transfer object For
example, if a table has 100 fields, the corresponding PO has 100 attributes. In most cases, DTO data comes from multiple tables, but the view layer only needs to display 10 fields, which is not necessary Pass the entire PO object to the client, then we can only use the DTO of these 10 attributes to transmit data to the client, so that the server-side table structure will not be exposed. After arriving at the client, if you use this object to correspond to the interface display, then his identity is VO at this time

POJO

plain ordinary java object Irregular simple java object
An intermediate object that can be converted to PO, DTO, VO
POJO after persistence ===>PO
POJO is used as the presentation layer ===>VO
POJO transmission process ===>DTO

Guess you like

Origin blog.csdn.net/qq_45796208/article/details/115355281