DDD. Strategic designing Bounded Contexts on a Web Project

172 views Asked by At

I'm starting on DDD and I have a doubt on application of DDD on a Web Project.

If I have multiple Bounded Contexts for every section of a web project. For example, "Catalog" and "Shopping Cart" on a E-Commerce project. ¿Where should be the code that implements the frontend for all the Web and presents concepts from many Bounded Contexts?

I have thought about creating the "Web" Bounded Context, but this Bounded Context won`t represent a specific Ubiquitous Language because this BC will use concepts of many Bounded Contexts and Subdomains.

What you do think about this?

Thanks.

1

There are 1 answers

0
ArwynFr On

Where this code goes depend on the structure of your application.

DDD is a set of patterns and rules that helps you model your business. This model should be ubiquitous, meaning different applications should share the same business logic. The main rule of DDD is what describes the business goes in the domain, everything else does not. DDD does not state anything about how to you should structure your application, it can be applied to any architecture.

What you describe is called presentation logic and does not describe your business logic. It describes how your system interacts with clients, which are external actors and is specific to your application: if you make a web or a mobile version of your app, chances are that you will have the same domain implementation but your presentation logic will slightly differ. So, there is no DDD answer to where the presentation logic goes, besides not in the domain.

If you make a traditional 3-layered application, this logic goes in the presentation layer.