Question about Entities and Domain.Shared #16163
Replies: 2 comments
-
I think this is more related to Clean Architecture instead of the ABP framework itself but I'll try my best to explain. In the clean architecture, entities are referred as business domain entities that include the core business rules for your application that should be valid for all of your applications. These business domain entities are subject to use cases which can be called application business rules. For short, the application layer covers the application rules and the entities cover the core business rules. ABP uses Domain.Shared layer to house some of the common principles for a flexible development experience. These are
Adding the Entities to the Domain.Shared layer is fundementally breaks the main idea of the Clean Architecture (or we can call Domain Driven Design). Since based on Clean Architecture, you should be exposing your entities through the application services. |
Beta Was this translation helpful? Give feedback.
-
thank you for explaining @gterdem Firstly I have to say, I'm learning clean architecture and ABP, although that, in my opinion I don't think clean architecture is good enough, it is just theory and that's why it has too many variant. Just want to discuss more about clean architecture, and base on CA, basically "entities" are core layer I wonder about hiding entity classes and just expose it in only boundary of domain will leak us to use too many DTO, and in reality when write code with ABP, we have to create many DTO. This leads to use automapper to save time, but automapper also has its drawbacks Can you show me what do you think, whether we can reuse entity and reduce using DTOs. |
Beta Was this translation helpful? Give feedback.
-
From this document: https://docs.abp.io/en/abp/latest/Best-Practices/Module-Architecture#domain-layer
And in The clean architecture design, Entity is core, it does not depend on any layer but opposite
I wonder why we can not share Entity to 3rd party, and can we put Entity to Shared layer
Beta Was this translation helpful? Give feedback.
All reactions