gseric
gseric

Reputation: 649

Structure of a single bounded context

Does bounded context span over all application layers (domain, application, presentation & infrastructure) or just domain model? For example should i use the following structure:

<bc 1>
 |_ domain
 |_ application
 |_ presentation
 |_ infrastructure
<bc 2>
 |_ domain
 |_ application
 |_ presentation
 |_ infrastructure

or the following:

domain
 |_ <bc 1>
 |_ <bc 2>
application
presentation
infrastructure

Upvotes: 19

Views: 2074

Answers (3)

Adam Siemion
Adam Siemion

Reputation: 16039

I think it is not a question about DDD precisely but about an architecture. What kind of coupling between bounded contexts is acceptable/desirable for you.

If all your bounded contexts will:

  • be developed in one programming language
  • access the same database engine
  • be developed by a relatively small team (up to ~20 people)

then probably you should go with the second approach - each bounded context contains its own domain and application layer and all the bounded contexts share the same infrastructure and application layer.

In other cases, you should considering the microservces/SOA architecture.

Upvotes: 0

MikeSW
MikeSW

Reputation: 16378

Both are valid approaches. I tend to favour the first option, because it allows better modularity and quite clear boundaries for high level BC. The second option is the 'standard' way of doing this, it favours let's say a more technical layering, while the first option literally favours a more domain driven layering.

Choose the one you feel more comfortable with.

Upvotes: 12

Arthis
Arthis

Reputation: 2293

do as you see fit. Each bounded context will have a different domain and surely a different application layer, but we may imagine a common Infrastructure layer ou presentation layer. It really depends on your architectural choices, and on the application you are trying to build.

If you want a more precise answer, add some material to your question, so that we can get your context and your problematic.

Upvotes: 2

Related Questions