Giter Club home page Giter Club logo

order's Issues

程序结构划分疑问

看了博主的代码,对于DDD程序结构有以下两个疑问

  1. 按照DDD的分层结构,为什么在你的工程里面是直接在Service层就对外暴露接口了呢
  2. 基础层在工程中没有体现
    以上两个疑问,不知是否可以给以说明

关于充血模型和贫血模型的疑惑

你好, 在复杂软件设计之道这本书的第123页说到:

这又验证了一句话, 服务被开发人员用作真正的银弹, 但最终成为得到贫血模型的最大原因......

这一句话要如何理解了?
我理解, 其实是贫血模型还是充血模型, 和用不用服务没有关系.
面向对象的设计其实说的是将数据和维护数据一致性的方法绑定起来, 从而能够为何内部数据的一致性,
比如linux的文件这个抽象概念, 虽然是过程式接口, 但是其实是面向对象的设计理念.
放到书中的例子, 服务如果提供了检查钱余额够不够, 那么和用类封装在一起, 还是提供服务对应的接口效果是一样的.
因此我认为, 不能简单的认为服务形式的方案就是贫血模型.
您看这里应该如何理解.

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.