Communicating between two Bounded Contexts in DDD

When integrating BCs, you have a few options. The reason that calling out to an external BC is discouraged is because it requires for both BCs to be operational at the same time. However, this is often quite acceptable and is simpler than the alternative. An alternative is to have the Game BC subscribe to … Read more

Multiple Aggregates / Repositories in one Transaction

I think what you really meant to ask was regarding ‘Multiple Aggregates in one transaction‘. I don’t believe there is anything wrong with using multiple repositories to fetch data in a transaction. Often during a transaction an aggregate will need information from other aggregates in order to make a decision on whether to, or how … Read more

Refactoring code to avoid anti-pattern

I wouldn’t say that it’s an anti-pattern since an anti-pattern is supposed to be a pattern in the first place (a recognizable, widespread way of doing things) and I don’t know of any “Repository-in-the-Domain-object” pattern. However, it’s certainly bad practice IMO because your BankAccount domain object mixes 3 responsibilities : Its natural and legitimate responsibility … Read more