为什么数据传输对象成为反模式?

编程入门 行业动态 更新时间:2024-10-27 02:29:54
本文介绍了为什么数据传输对象成为反模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我最近听到有人说,数据传输对象(DTO)是一种反模式。

有人可以解释一下为什么吗?什么是替代方案?

解决方案

某些项目拥有所有数据两次。一次作为域对象,一次作为数据传输对象。

这个复制具有巨大的成本,所以架构需要从这种分离中获得巨大的收益才值得。

I've recently overheard people saying that Data Transfer Objects (DTO) are an anti-pattern.

Can someone please explain why? What are the alternatives?

解决方案

Some projects have all data twice. Once as domain objects, and once as data transfer objects.

This duplication has a huge cost, so the architecture needs to get a huge benefit from this separation to be worth it.

更多推荐

为什么数据传输对象成为反模式?

本文发布于:2023-07-27 11:44:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1222280.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据传输   对象   模式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!