I was curious to know what some developers out in the industry are doing when it comes to exposing Data access logic, specifically persistence. This is assuming that your not using an O/R framework or something that completely abstracts you from the persistence details.
Are you:
1. Having simple data type interfaces and the data layer know nothing about the domain models. For example:
public int SaveCustomer( string fname, string lname, string ssn, string phoneNumber)
2. While this may anger OO peeps, does your DAL know about the domain model. For example:
public int SaveCustomer ( Customer customer )
3. Other, like generic datasets or typed datasets?
I am really interested in the decision whether or not to allow the DAL to "know" about the domain model. I understand the fact that a change to the model can have a rippling effect, but personally the maintenance ease of sharing these common objects across the enterprise makes is worthy decision.
Also, where are your business entities being created. Are they being mapped within the BAL or does your DAL perform the mapping. Again, from readings, idealistically the mapping should *not* occur in the DAL. Instead it should be done by the business layer. But if you move forward with a domain model approach and allow your DAL to know about the domain model you will already require a reference to the domain model lib. In that case, why not build a generic base DAL that know how to build the business entities in a structured common way. Odds are that since u are using the domain model approach any changes to the domain model will probably affect the DAL.
I think this guy is right on the $$$ with the tradeoffs but I like this style. Am I crazy here? The last system I worked on was built like this and by the time we were done we knew it forward and backward and it was a breeze to work with. BUT, we did things in which the DAL created the business entities and the DAL was aware of the business entities. Hind site I am questioning that; at the same time I personally thought it was easy to maintain and have since heard ( I left there ) that they are really pleased with it and the maintenance is easy.
Kevin C