Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

感觉实际开发过程中,很少会这么规范去写吧? #1

Open
kaitezhan opened this issue May 27, 2022 · 5 comments
Open

Comments

@kaitezhan
Copy link

看了下代码一个DTO、VO、DO 的转换都3次,效率上会比MVC低很多,不知道各位如何看待?

@guohangbk
Copy link

有的,我们公司有些项目的同事时就是这样写的,在很多类中都充斥着对象装换,我也接受不了。。。

@yunjiangs
Copy link

前提:不需要极致效率
如果仅仅是对象转换,我也接受不了转换这么多次,真有需要字段属性变更的应该放在服务提供处去处理,我更喜欢用hutools的BeanUtil.copyProperty() ,效率快,成本低,底层sql定义好就行了

@lml200701158
Copy link
Owner

是的,不过真正使用时,也可以不用搞这么麻烦,比如我们项目,就直接用 VO 返回,不用 DTO 转 VO

@future94
Copy link

mapStruct转呗

@guigevip
Copy link

guigevip commented Jul 7, 2022

总感觉DDD的理论性太强,不知道有没有最佳实践

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants