|
I am a bit confused about when to use connected or disconnected classes when creating an ASP.NET application. Tradition 3-tier apps almost always show that the business layer contains BO (business objects) that are nothing but data containers mapped directly from tables. These classes are coupled with BAL (business application layer) classes. The BO gets exchanged between the BAL and DAL (data access layer).
When can we then use DataTables and DataSets then? Should BO be eliminated in these cases? Is there a need to convert a DataTable to a business object in the business tier?
|
|
|
|
|
IMHO the answer is that you shouldn't use DataTable and DataSet objects at all.
The reason behind using business objects is that (a least in theory) you are not dependant on database. That allows you test your code without db and also think about your code without database context (using "objects" instead of "rows").
Also without additional work, DataTable objects are not strongly typed so you won't find type mismatch errors until runtime.
You know, Entity Framework and similar tools exist for a reason
--
"My software never has bugs. It just develops random features."
|
|
|
|
|