The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Where to put object abstractions ?

Hi just wondering if you could help me with this one.

Where abouts do you combine parent/child items into their object ?

e.g. if you have an order with an order and line items and you wanted to retrieve an order which contained both would the datalayer do this for you and whats everybody doing in terms of the number of database hits, would you use 1 stored procdure to get two result sets back or do you use two seperate stored procedures one to get the header and one to get the line items ? If you used one stored procedure there may be the case you are repeating yourself as you may just want to get the line items back on their own...

Just interested on what everyone os doing out there !
Andy D Send private email
Thursday, December 22, 2005
i usually copy such abstractions to data access layer. for example  GetOrder function in DAL class which fills the business entity (typed dataset) using two stored procedures, one for order other for order lines.

Thursday, December 22, 2005
If you just wanted the order info, you could conceivably fetch the whole ball of wax and then throw away the line items.  Most of the time, that's a waste of processor resources and if you're running a high volume e-commerce site (following the example), all that needless processing starts to really add up.  Bite the bullet and design two interfaces.

+1 to the invisible man.
Anonymous Coward
Thursday, December 22, 2005

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz