Question

in the book dependency injection in .net (a great book thanks mark). in page 41 MISCELLANEOUS OTHER ISSUES : he speaks about one anti pattern, ui that reference DAL and BLL, DAL that defines Domain Objects (entity framework autogenerated objects) he says :

Most of the Domain Model seems to be implemented in the Data Access library. Whereas it’s a technical problem that the Domain Model library references the Data Access library, it’s a conceptual problem that the Data Access library defines such a class as the Product class. A public Product class belongs in the Domain Model.

i do understand that DAL must not define domain objects.but I don't understand why DML reference DAL is a technical problem? Are we talking about the BLL(business logic layer) when he speaks about Domain Model Library.

Was it helpful?

Solution

Yes, Domain Model Library (DML) is a Business Logic Layer (BLL). This library should contain domain model entities (which should be persistent ignorant) and domain services.

Why that is a technical problem? Any changes in DAL will require compilation of DML. If you will inverse dependency, then DAL will act as a plugin for you domain. You will be free to change it (persist data in memory, file, or use other db provider) without affecting BLL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top