New answers tagged

1

Is this a significant problem? Maybe? How important are differences in timing between the different projections? Assuming that these projections are listening to the events independently of each other, there can be a bit of drift when the projector gets ahead of, or falls behind, the html renderer. What happens to the html renderer if the database is ...


2

Should domain models instantiate other domain models? Domain models are not instantiated, instead we instantiate entities, aggregates, aggregate roots, etc.. The method below to reserve seats is in a service. Using the unadorned term "service" is error prone. Have a look at this, which discusses the differences between domain services and ...


0

Most of the time, it doesn't need to know; aggregates with correctly designed boundaries don't need to know about outside state to maintain its invariant (that's basically the definition of an aggregate boundary). When an aggregate needs to know about state outside it's own boundary, the usual answer is a DomainService. The aggregate invokes a query on the ...


0

Trusting the dependent class that it works properly, hoping there would fail some unit tests when something there does not work, then it should this be tested very vell. Maybe there are missing some important unit tests? There can be an untested case that would create an error, that will be produced in my originary testing class, and would not be catched in ...


1

Is there a recommended way to handle this scenaio? You need to review Jim Webber's talk on DDD for Restful systems. The basic plot - to modify your aggregates, you deliver documents (aka messages) to your HTTP endpoints, and the changes made to your aggregates are a side effect of the document manipulation. So solution (a) is heading the right direction. ...


2

I will try to be exhaustive about the possible solutions that you might use. As you wrote, I consider that a product has the following attributes : id, name, availability 1. Designing a resource for each attributes /products/555/name: GET returns the current name of the product id 555. PUT newname modify the current name of the product id 555 with newname ...


0

Geert-Jan, I too think the compensation action can simply delete the corresponding event(s). It makes sense and it shows another benefit of Event Sourcing design pattern: easier implementation of the Compensating Transaction design pattern. Some say deleting the event violates the "principles" of event sourcing or CQRS. I think that's a limiting ...


-3

If you're interesting in learning DDD, you can check out this book https://www.amazon.co.uk/Implementing-Domain-Driven-Design-Vaughn-Vernon/dp/0321834577 The author also has many articles online which are basically taken from the book, the author is: Vaughn Vernon. Also, search for DDD and Greg Young and you can also find relevant resources. But the book ...


0

When using DDD in OOP, one of the main reasons to put business logic in the domain objects themselves is that business logic is usually applyed by mutating the state of the object. This is related to encapsulation: Employee.RaiseSalary probably mutates the salary field of the Employee instance, which should not be publicly settable. In FP, mutation is ...


2

The important question to ask, when designing aggregates, is how does the data change? For team to be an aggregate implies that it has some state, and even after that state changes it is still the same team. (ie, for team to be an aggregate, it must be an entity -- not merely a value type). So in your model, do teams change in any interesting ways? By ...



Top 50 recent answers are included