I am in the middle of a \"discussion\" with a colleague about the best way to implement the data layer in a new application.
One viewpoint is that the data layer should
One trick I've found handy is to have my data layer be "collection agnostic". That is, whenever I want to return a list of objects from my data layer, I get the caller to pass in the list. So instead of this:
public IList GetFoosById(int id) { ... }
I do this:
public void GetFoosById(IList foos, int id) { ... }
This lets me pass in a plain old List if that's all I need, or a more intelligent implementation of IList
This still means that my data layer knows about my object definitions, but it gives me one extra degree of flexibility.