本文介绍了为什么数据传输对象成为反模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最近听到有人说,数据传输对象(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.
更多推荐
为什么数据传输对象成为反模式?
发布评论