Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Design For This
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01390847
Message ID:
01390942
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.

Personally I like having one call available that will bring back ALL relevant info for ONE customer (assuming they're not likely to have hundreds of invoices or thousands of lines) . Obviously it is not suitable for all purposes but other calls can be used for narrower requirements.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform