当前位置:网站首页>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,传递给持久层,由持久层完成持久化操作
边栏推荐
- 科目三: 直线行驶
- Redis: 配置AOF不起作用
- Pointer elementary of C language
- Kubernetes第七篇:使用kubernetes部署prometheus+grafana监控系统(Kubernetes工作实践类)
- KMP模板——字符串匹配
- 了解Bom与DOM的基本属性
- Program environment and preprocessing of C language
- 今日睡眠质量记录82分
- The chess robot broke the finger of a 7-year-old boy. Netizen: it violated the first law of robots
- Storage of data in C language
猜你喜欢

Understand the basic properties of BOM and DOM

大厂们终于无法忍受“加一秒”了,微软谷歌Meta等公司提议废除闰秒

C语言之数组

通过 FileUploader 的初始化,了解 SAP UI5 应用的 StaticArea 初始化逻辑

Flex flex flex box layout

SAP UI5 FileUploader 的本地文件上传技术实现分享

Can deep learning overturn video codec? The first prize winner of the National Technological Invention Award nags you in the little red book

Dynamic memory allocation in C language

Niuke topic - parity rearrangement of linked list, right view of output binary tree, bracket generation, first non repeating character in character stream

Structure and bit segment of C language
随机推荐
Day 7 summary & homework
About paths mapping in SAP ui5 application ui5.yaml
Mobile end Foundation
High precision timer
Hegong sky team vision training Day7 - vision, Jetson naon and d435i
Niuke topic -- binary search tree and bidirectional linked list
Select structure
Complete steps of JDBC program implementation
Three table joint query 3
Storage of data in C language
大排量硬核产品来袭,坦克品牌能否冲破自主品牌天花板?
Why is domestic Xinguan oral medicine a drug for the treatment of AIDS
Purchase in Appstore
7 岁男孩被 AI 机器人折断手指,仅因下棋太快?
Niuke topic -- Realizing queues with two stacks, stacks containing min functions, and valid bracket sequences
webView基本使用
Measured: the performance of cloud RDS MySQL is 1.6 times that of self built
深度学习能颠覆视频编解码吗?国家技术发明奖一等奖得主在小红书给你唠
信号量保护之位带操作
Shell编程规范与变量