0
votes

I am ddd/cqrs/event sourcing beginner, and I have some conceptual problems.

For example, I want to implement a simple shopping cart, and it have to bounded context: admin and website. Both will talk to a same aggregate: order.

In this case, can I share aggregates cross bounded context? If not, how can I do it in the above example?

Cheers, Ron

2
What are the scenarios that are driving this? A user can place an order on the website, but what can an administrator do with it? Have you entertained the possibility that Orders is a BC on its own?JefClaes
An administrator can approve order, refund order, and so on... Yes, order could be a BC on its own, that's a good idea.Ron

2 Answers

2
votes

You can use shared kernel if you must share portions of the model between two or more bounded contexts. With that said, it's worth asking whether the meaning, structure and behavior of the of Order in both these contexts are exactly the same. If not, you would be better off maintaining them in both the bounded contexts.

Aggregate in DDD

1
votes

An aggregate root belongs only to one bounded context. You can talk to that aggregate from other BC using the published language (contracts/commands). What you need is to draw your context map and decide which BC is upstream and which one is downstream. This is really important.

Check this article => http://www.infoq.com/articles/ddd-contextmapping