Coder Social home page Coder Social logo

Comments (5)

lmlx66 avatar lmlx66 commented on June 1, 2024

我个人觉得都放。

from cola.

harborlee avatar harborlee commented on June 1, 2024

个人觉得,枚举不应该对外,client层和基础层不应使用枚举。枚举应该放在domain层,app层可以通过依赖domain层来使用该枚举。

from cola.

lvxi0605 avatar lvxi0605 commented on June 1, 2024

个人觉得,枚举不应该对外,client层和基础层不应使用枚举。枚举应该放在domain层,app层可以通过依赖domain层来使用该枚举。

dubbo调用时也不建议用枚举作为参数传递,但是之前做的项目就是每层都要转换,request对象转domain对象,domain对象转po,枚举都要转成String或者Integer, String或者Integer 转换成 枚举 ,还是挺麻烦的

from cola.

allenbin avatar allenbin commented on June 1, 2024

枚举一般我们有两个主要用途,业务的辅助逻辑判断和渲染数据时文本转换等,所以domain和app层都会用到,我觉得放在基础实施层的common包中

from cola.

yicone avatar yicone commented on June 1, 2024

domain层需要的枚举,放在domain层,因为domain层不应依赖于infra层;除此之外的、其它层需要的枚举,放在infra层。
就好像各层都有class一样,认为枚举“放在一起好管理”的这种思路是不合适的。

from cola.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.