简体   繁体   中英

What is the materialization of Bounded Context? (C# / .NET)

I have a bit of a hard time understanding of how is Bounded Context materialized in c# / .net core? Is it a project (assembly), folder, class or none of the above?

I see in microservices architecture that some advocate for Bounded Context corresponding to one microservice and that makes sense to me. On the other hand, i have a hard time getting it outside of microservices world.

So, in typical monolith - what does it materialize into?

Bounded context it is only about lexical boundaries. Even in microservices, one bounded context can contains several microservices (but not the other way around). So it depends on you. Eg In monolith it could be just one project, but it could be several projects in one folder.

So the most flexible answer would be several projects in one folder

If you have no special deployment requirements I would say everything that allows you to restrict visibility. In the java world that would probably be a package (if not a Java9+ module). That way you can ensure that nothing "internal" leaks the BC and public implementations designed to be consumed somewhere else can be marked that way.

If you have special deployment requirements (BC x should be deployable independent of others if there is no backwards breakage) you could consider modularizing to have every BC correspond to one artifact (.jar or .dll or whatever). This is kind of a microservicy approach but within a monolithic development environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM