What is a bounded context?

What is a bounded context?

A bounded context is simply the boundary within a domain where a particular domain model applies. In the book Domain Driven Design, Eric Evans describes several patterns for maintaining the integrity of a domain model when it interacts with another bounded context.

What is bounded context in Microservices?

In the context of Microservices, it means one simple thing: a Bounded Context is the exact opposite of a Microservice! A Bounded Context defines the boundaries of the biggest services possible: services that won’t have any conflicting models inside of them.

What does bounded context mean in relation to Microservices?

In the context of Microservices, it means one simple thing: a Bounded Context is the exact opposite of a Microservice! A Bounded Context defines the boundaries of the biggest services possible: services that won’t have any conflicting models inside of them. Not every Bounded Context is a Microservice.

How do you define bounded context in DDD?

A bounded context is the boundary of a model that represents those concepts, their relationships, and their rules. The same subdomain could be represented by an infinite number of modelling choices. A model in DDD can be represented in a variety of formats such as post-it notes or code.

Can a bounded context have multiple Microservices?

Bounded Contexts are NOT Microservices.

Which is the best definition of bounded context?

Bounded contexts. Bounded context is a logical boundary When both sub-domains and the core domain are defined, it’s time to implement the code. Bounded context defines tangible boundaries of applicability of some sub-domain. It is an area where a certain sub-domain makes sense, while the others don’t.

What are core domain, generic domain and bounded context?

DDD owns the concepts of Core Domain, Generic Domain and Bounded Context. What is it, how to define them and is there any connection with business-capabilities? Domain is the reality we inhabit: its entities, their behavior, laws they obey.

Why do we use bounded contexts in DDD?

The most frequent reason is some legacy-system that was built without DDD approach in mind. Bounded contexts in such systems can expose several sub-domains. What it might look like? Simple example, PSP, as usual. One sub-domain represents transaction processing logic, and the other — transaction reconciliation logic.

Can a microservice span more than one bounded context?

In general, the functionality in a microservice should not span more than one bounded context. By definition, a bounded context marks the boundary of a particular domain model. If you find that a microservice mixes different domain models together, that’s a sign that you may need to go back and refine your domain analysis.