Coder Social home page Coder Social logo

dddfirework's People

Contributors

archever avatar dd-rebecca avatar ealyn avatar jeremy-run avatar joyme123 avatar kirinzhong avatar liqiankun1111 avatar qiankunli avatar yeehomfoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dddfirework's Issues

新增eventbus监控指标特性

事件异步处理是一个十分常见的业务场景,通过eventbus可方便发送和处理异步事件。

异步事件带来便利的同时,也容易把问题隐藏起来,发现和定位问题变困难了。为了加速问题发现和定位,需要eventbus提供观测能力,通过监控指标暴露当期事件处理情况:处理速度、积压情况、处理延迟、失败率等。

新增定时任务特性

定时任务是一个十分常见的业务场景,例如每天凌晨 1 点刷新用户成就。当前也有很多成熟的外部方案,例如 k8s 的 Cronjob,带有定时器的 FaaS ,还有很多支持分布式定时器的三方组件。

由框架本身集成定时功能具有很多好处:1,业务逻辑可以更好内聚到领域层,开发定时任务跟开发一个普通的应用层 Command 一样;2,业务侵入性更低,接入定时不需要做过多的代码改造;3,贯彻框架“隔离业务与技术复杂度”的宗旨。

解决 Act 方法中删除聚合根的歧义问题

当前,在 Act 方法中删除聚合根的操作有较大歧义,开发者很容易会忘记在 Build 中返回,而直接通过 RootContainer.Remove 方法删除一个新建的聚合根,导致删除失败。

究其原因,RootContainer.Remove 的方法接受一个聚合根,语义上未明确是必须 “在 RootContainer 里面的聚合根”,并且该方法没有直接返回错误。

我们可以做以下改进:

  1. 修改 Act 方法签名为 "Act(ctx context.Context, container ddd.RootContainer) error" ,把 roots ...ddd.IEntity 参数去掉,同时在 RootContainer 新增 GetRoot 方法获取 Build 方法中返回的聚合根。好处是让用户建立 RootContainer 即接受 Build 参数的容器的概念,从而 Remove 也自然需要是已经在容器中的聚合根。

  2. 在 RootContainer.Remove 增加错误返回,强化传入一个非法聚合根的错误提示。

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.