GithubHelp home page GithubHelp logo

domain-driven-design's People

Contributors

juliendufresne 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

Watchers

 avatar  avatar  avatar  avatar

domain-driven-design's Issues

Basic tools to create Domain objects

We need to define an AbstractAggregateRoot in order to have some basic facilities:

  • get the list of events triggered
  • define some rules to apply Event

Add event logging capability

One of the advantage of the event system is to give the ability to log every events that occurs in an application.

This should be built-in.
Furthermore, this will also give us a great example on how a bounded context looks like.

Command system

When it comes to change the state of an aggregate whether it's an addition, a deletion or a modification, it's probably a better idea not to have the same flow as when we read it.

The CQRS (command query responsibility segregation) design pattern is a way to fix that issue by defining a clear separation between the read and the write model.

We need to have this kind of feature inside our solution.

What should be included:

  • an abstract Command object will give a draft of how to create a command,
  • define what a CommandHandler should look like (class responsible of handling a command)
  • create a CommandDispatcher (looks like an EventDispatcher but for command)

Event System

In Domain Driven Design, an event system allows to do some actions when something happened in an Aggregate.

Our event system should be able to:

  • define a base Event named AbstractEvent
  • define an EventDispatcher
    • centralize every listeners to have more control
  • have some listeners
    • subscribe to as many events as needed
    • subscribe to an Interface of a parent class (allows to act on multiple event the same way)

Link between Command and Event

Now we have a command system and an event system. They are separate but can definitely work together.

We need to provide a link between the two systems: a CommandEventDispatcher.
This will be able to start from a Command, handle it and then publish all the events that the command triggered.
We may also only want to publish an Event from this dispatcher.

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.