quote:Originally posted by djm2cmu
In the book, there are several instances where they pass a DataSet up out of the data layer, through the business layer, and up to the presentation layer. I can see why this is useful for databinding etc, but doesn't that totally break the concept of layered abstractions? Now, if I make a change to the database schema, the change is not localized to the Data Layer classes...it affects all layers.
You're right. The solution I prefer for databinding is to use custom collections, as described in the APress book: Real World ASP.NET Best Practices. By using collections you can control what info is passed between layers and you don't have to pass every field in the DB. The collections are each created by a business object. The business object layer reads from the data layer and creates the desired collections, and they are passed up to the presentation layer.
However, having said that, it's very hard to isolate changes to one layer because many changes will inherantly apply to more than one layer. But it does help with small changes - like if you want to add one field to be used by one functional area, you want to keep that change contained as much as possible.