The difference between VO and DTO

VO (View Object) is used to represent a view object that interacts with the front end. Its function is to encapsulate all data of a specified page (or component). In fact, the VO here only contains the data that the front end needs to display. For the data that the front end does not need, such as data creation and modification time and other fields, for the purpose of reducing the amount of transmitted data and protecting the database structure from leakage, it should not be Reflected in VO.

DTO (Data Transfer Object) is used to represent a data transfer object. DTO is usually used for data transfer objects between the presentation layer (Controller) and the service layer (Service). DTO is similar in concept to VO, and usually the fields are basically the same. However, there are some differences between DTO and VO. This difference is mainly due to design concepts. For example, the DTO required for API services may be different from VO.

Reprinted https://blog.csdn.net/lairikeqi/article/details/106081782?spm=1001.2101.3001.6661.1&UTM_MediUM=PC_RELEVANT_T0.NONE-task -blog-2%7EDEFALT%7EBLOGCOMDENDFROMBAIDU%7raate-106081782-BLOG -86597851.pc_relevant_vip_default&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-106081782-blog-86597851.pc_relevant_vip_default&utm_relevant_index=1

Guess you like

Origin blog.csdn.net/weixin_51966599/article/details/127634373