Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Design For This
Message
 
To
24/03/2009 16:49:36
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01390847
Message ID:
01391219
Views:
66
Because the DataReader is more lightweight?


>No, I'm loading right from the DataReader to my class.
>
>>Mike,
>>
>>You have mentioned a couple of times that you don't use DataSets. Do you mean that the data comes back as a DataSet, but then you load the data onto class properties, as I'm doing here?
>>
>>
>>
>>>>>>I have a customer record, which has one or more account records. Each account can have one or more invoice headers, each with one or more invoice detail records. I wrote a class for each.
>>>>>>
>>>>>>When I create an instance of a customer class and call LoadCustomer, should that process also create a collection of accounts on the customer class. Then, should each account create a collection of invoice headers, which in turn would create a collection of invoice details?
>>>>>
>>>>>I'm assuming you're talking about DataSets? This is the area where DataSets got a little fuzzy for me (I admit it's probably from my own lack of knowledge) and it why I switched to custom objects.
>>>>
>>>>Not necessarily DataSets. I'm pulling the customer data into a DS, but then I copy the data to properties on the class My Customer class has an Address collection, and when I load the customer's data I also load a collection of addresses. These addresses are classes with properties for the address data.
>>>>
>>>>The question really is: Is it a good idea to create hierarchies of classes? I have always heard "Pull what you need, need what you pull", so if I create this cascading data class hierarchy, I could end up with a bunch of data in classes that I might not use on each call.
>>>
>>>I'm interested on why you're taking a mixed approach (DataSets and Custom Objects). I think it's really a judgement call with Custom Classes on how far down the hierarchy you load the data. You can always perform Lazy Loading if you feel it suits your needs.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform