Just another Domain Driven Design and EventSourcing example written in Java.
- The AggregateRoot abstract class provides a mechanism to guarantee the consistency of changes being made internally by forbidding external objects from holding references to its members.
- The AggregateRootEvent and the EntityEvent abstract classes are used to represent respectively a change applied to an AggregateRoot and to an Entity.
- Repositories expose methods for retrieving and saving AggregateRoots by accessing to an EventStore. You can find simple in-memory implementations here.
- In this example, Product and a BacklogItem are two AggregateRoots. ProductBacklogItem is an Entity. StoryPoints is a ValueObject. These implementations are based on "Implementing Domain Driven Design" book written by Vaughn Vernon. You will find some unit tests showing their behaviors and interactions.