After a month or so of reading and researching DDD, I decided to start my own project and created DDD with these bounded contexts>
- Clients
- Products
- Orders
- Billing
Each bounded context has rest API as a presentation layer, domain layer, persistent layer.
So far so good, code is running smooth, but coming from a monolithic world, I am still trying to figure out the following:
- when I want to create a new client, issue new invoice, create new order I want to for example access list of countries. Do I:
a) create a list of countries in each BC
b) create a Countries BC -> API and use it to get a list of available countries
c) use a 3rd party API and pull data via anticoruption layer in each BC
- when integrating with 3rd party API using an anti-coruption layer or an adapter layer, what data has to be included in my domain model? For example if I want to integrate a zendesk API with a Client BC. Do I need just a ticketID in my domain, or I have to extract all the data from Zendesk that I want to access and use in a Client BC?
If my MVC app is actually getting data from APIs (presentation layers of my bounded contexts) I find it very difficult to clearly define boundaries of each BC. Does it mean that a properly designed BC would serve a single MVC controller without a need to consume additional APIs?