Thanks for the replies.
After re-reading what I posted I came to my own conclussion on what would be better. DataTables/DataSets are best used when used for, well tabular display. Sure they can be used as a Business Object to be passed through teirs, but complex objects are better for that, in our case.
A List<T> of objects is useful to avoid subsequent lookups.
TAsSunder, what we've done in cases like that is have collections as properties (set to null) until accessed. If you wanted to grab the history of the user, which is a List of all history. It is not populated until you ask for that history, and then returns the List.
The example in question was this:
Return a list of users. Each of those users will have a collection of data:
-History
-Roles
-Departments the user is a part of
-Email lists the user is a part of.
Instead of having a DataTable as each of those seperate collections, Would it have been better to have List<t>'s of Complex business objects for each one? The conclussion I came up with is that it depends on how I want to render the to the user.
For roles, the user only gets a list of roles with a lot of Front end JavaScript to support adding and removing with ease. A List<t> is better for that.
For History, which does not need to support full CRUD, only Create and Retrieve, it's better as a standard DataTable.
The Killer Ninja Coding Monkeys thank those that mark helpful posts as answers.
My Site |
My Examples |
My Blog 