Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Design For This
Message
From
24/03/2009 09:13:59
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:
01390986
Views:
65
>>>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.
Very fitting: http://xkcd.com/386/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform