angular-architects / nx-ddd-plugin

Nx plugin for structuring a monorepo with domains and layers
313 stars 56 forks source link

[Question] What could an API look like? #70

Closed PhilippFreibauer closed 2 years ago

PhilippFreibauer commented 3 years ago

Assuming I have two domains, a product and an order, the order requires data from the product and then has to access the corresponding domain via an API. What could an API look like here? Is the product data service for the other domain simply exported in a module?

manfredsteyer commented 3 years ago

Hi Philipp,

it's basically a lib with just an index.ts exporting other stuff from the domain.

jon9090 commented 2 years ago

@manfredsteyer it can be exporting also feature modules? to use in another libs?

manfredsteyer commented 2 years ago

In theory, yes. However, if you allow an API to export features, you can end up with cycles. Hence, I really try hard to prevent the need for this.