什么是DTO?
2015-12-25 14:04
447 查看
DTO: Data Transfer Object
Wikipedia定义:Data transfer object (DTO)[1][2] is an object that carries data between processes. The motivation for its use has to do with the fact that communication between processes is usually done resorting to remote interfaces (e.g. web services), where each call is an expensive operation.[2] Because the majority of the cost of each call is related to the round-trip time between the client and the server, one way of reducing the number of calls is to use an object (the DTO) that aggregates the data that would have been transferred by the several calls, but that is served by one call only.[2]
也就是说DTO的出现实际上是为了减少cost的。
和类似概念的区别:The difference between data transfer objects and business objects or data access objects is that a DTO does not have any behavior except for storage and retrieval of its own data (accessors and mutators). DTOs are simple objects that should not contain any business logic that would require testing.
也就是说DTO除了getter和setter之外不包含任何业务逻辑。
Wikipedia定义:Data transfer object (DTO)[1][2] is an object that carries data between processes. The motivation for its use has to do with the fact that communication between processes is usually done resorting to remote interfaces (e.g. web services), where each call is an expensive operation.[2] Because the majority of the cost of each call is related to the round-trip time between the client and the server, one way of reducing the number of calls is to use an object (the DTO) that aggregates the data that would have been transferred by the several calls, but that is served by one call only.[2]
也就是说DTO的出现实际上是为了减少cost的。
和类似概念的区别:The difference between data transfer objects and business objects or data access objects is that a DTO does not have any behavior except for storage and retrieval of its own data (accessors and mutators). DTOs are simple objects that should not contain any business logic that would require testing.
也就是说DTO除了getter和setter之外不包含任何业务逻辑。
相关文章推荐
- 进程监控工具supervisor 启动Mongodb
- 在Apache+mod_wsgi+python的基础上搭建https安全访问
- Python编程(二):Python进程、线程的那点事儿
- 行为型:设计模式之访问者模式(二十三)
- 用流域和最佳的阈值进行慢性淋巴细胞性白血病细胞分割
- Java程序员之JS(一) 入门
- 小记录
- 嵌入式Linux学习-----u-boot移植
- iOS_字符串显示不同颜色
- socket小实例
- Android 图片Exif信息相关的获取与修改
- Activity Task
- 用OKR制定目标
- 程序员最好的时代来了(3)
- 搭建Apache+mod_wsgi+python+flask+virtualenv网站正式环境
- Web.xml配置详解之context-param
- 行为型:设计模式之解释器模式(二十二)
- Java String.split用法小结
- 获取未安装的App信息
- 小谈APP产品设计