当前位置:网站首页>VO、DO、DTO、PO是什么
VO、DO、DTO、PO是什么
2022-07-27 15:18:00 【玉面大蛟龙】
1、VO
vo(view object)视图对象
用于展示层,它的作用是把某个指定页面(或组件)的所有数据封装起来,一般由后端传输给前端。
2、DTO
DTO(data transfer object)数据传输对象
用于展示层和逻辑层之间的数据传输。
3、DO
DO(domain object)
从现实世界中抽离出来的有形或无形的业务实体。
4、PO
po(persistent object)
跟持久层的数据结构构成一一对应关系。如果持久层是关系型数据库,那么PO的属性和数据库中的字段一一对应。
5、VO和DTO的区别
他们最本质的区别是:VO代表了需要展示的数据,DTO代表服务层需要接收和返回的数据。
举例
以一个填写表单的操作为例:
- 用户填写表单,表单的数据在展示层被匹配为VO
- 展示层把VO转换为服务层要求的DTO,传给服务层
- 服务层首先根据DTO构建一个DO,调用DO的业务方法完成具体业务
- 服务层将DO转换为PO,传递给持久层,由持久层完成持久化操作
边栏推荐
- 如何通过C#/VB.NET从PDF中提取表格
- Niuke topic -- Realizing queues with two stacks, stacks containing min functions, and valid bracket sequences
- Niuke topic - parity rearrangement of linked list, right view of output binary tree, bracket generation, first non repeating character in character stream
- Passive income: return to the original and safe two ways to earn
- Global string object (function type) +math object
- SAP UI5 FileUploader 使用的隐藏 iframe 和 form 元素的设计明细
- Technical practice dry goods | from workflow to workflow
- 项目练习:表格的查改功能
- Reference of meta data placeholder
- Share a scheme of "redis" to realize "chat round system" that can't be found on the Internet
猜你喜欢

How to extract tables from PDF through C /vb.net

Niuke topic -- judge whether it is a complete binary tree or a balanced binary tree

ES6数组新增属性

js中的函数

Storage of data in C language

The chess robot broke the finger of a 7-year-old boy. Netizen: it violated the first law of robots

Enumeration and union of C language

Three table joint query 3

今日睡眠质量记录82分

webView基本使用
随机推荐
每条你收藏的资讯背后,都离不开TA
神经网络实现手写数字分类matlab
三表联查2
Hegong sky team vision training Day7 - vision, Jetson naon and d435i
How to extract tables from PDF through C /vb.net
Gartner authority predicts eight development trends of network security in the next four years
High cost, difficult to implement, slow to take effect, what about open source security?
JDBC connection database
大排量硬核产品来袭,坦克品牌能否冲破自主品牌天花板?
全局String对象(函数类型)+Math对象
Xcode releases test package testflight
Shell programming specifications and variables
.NET Core with 微服务 - 什么是微服务
Svm+surf+k-means flower classification (matlab)
VS2019 C语言如何同时运行多个项目,如何在一个项目中添加多个包含main函数的源文件并分别调试运行
High precision timer
C语言之分支循环语句
合工大苍穹战队视觉组培训Day7——视觉,jetson naon与D435i
Three table joint query 1
Shardingsphere-proxy-5.0.0 distributed snowflake ID generation (III)