Question

Simple question for which I think I have an answer but I am looking for a sounding board. Should the DAL be the one translating whatever comes from the database (be it through straight SQL, stored procedures, ORM, whatever) into Domain Entities as understood by the business layer? On a separate note, should all Domain Entities be defined by an Interface (if nothing else, to minimize dependencies) ?

Was it helpful?

Solution

Should the DAL be the one translating whatever comes from the database (be it through straight SQL, stored procedures, ORM, whatever) into Domain Entities as understood by the business layer?

In my opinion, yes. I'm not sure there is a hard and fast rule though.

On a separate note, should all Domain Entities be defined by an Interface (if nothing else, to minimize dependencies) ?

In my opinion, no. That may end up in a lot of interfaces that add no value. YAGNI.

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