-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Client 和 基础层都用到的枚举类应该放哪里? #435
Comments
我个人觉得都放。 |
个人觉得,枚举不应该对外,client层和基础层不应使用枚举。枚举应该放在domain层,app层可以通过依赖domain层来使用该枚举。 |
dubbo调用时也不建议用枚举作为参数传递,但是之前做的项目就是每层都要转换,request对象转domain对象,domain对象转po,枚举都要转成String或者Integer, String或者Integer 转换成 枚举 ,还是挺麻烦的 |
枚举一般我们有两个主要用途,业务的辅助逻辑判断和渲染数据时文本转换等,所以domain和app层都会用到,我觉得放在基础实施层的common包中 |
domain层需要的枚举,放在domain层,因为domain层不应依赖于infra层;除此之外的、其它层需要的枚举,放在infra层。 |
No description provided.
The text was updated successfully, but these errors were encountered: