Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2007, 08:00 AM
elbandit's Avatar
Wrox Author
 
Join Date: May 2007
Posts: 107
Thanks: 10
Thanked 17 Times in 15 Posts
Default OrderHistory Multiple Database Trips

Hello,

Is there a better, more efficent way of populating the OrderItems (BLL) collection for each Order (BLL) rather than calling the database to get the OrderItems after creating each order. Could one stored procedure be designed to pull back all the information and then populate the OrderDetails (DAL) and OrderItemDetails (DAL) objects, then hand these back to the BusinessLogicLayer so that it could create the Orders (BLL) and then when creating the orderItems(BLL) the BusinessLogicLayer could loop through the collection of OrderItemDetails(DAL) to retrieve the orderItems (BLL) for each order. I guess one way to implement this would be to have the DAL return an 'OrderHistory' object that
contained a list of OrderDetails (DAL) and a list of OrderItemDetails (DAL). Then the business layer could sort this with out a trip for each order to the DB as seen in the method

GetOrderFromOrderDetails in App_Code/BLL/Store/Order.cs

Has anyone thought about this or have any ideas? Its just if I have 20 orders to display for a customer then its one trip to the database to get the list of orders and another 20 to get the order deails for each one.

Cheers
Scott

 
Old May 9th, 2007, 10:52 AM
elbandit's Avatar
Wrox Author
 
Join Date: May 2007
Posts: 107
Thanks: 10
Thanked 17 Times in 15 Posts
Default

Is the above called 'Lazy loading'?






Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple records in database svk SQL Language 1 May 18th, 2008 03:59 AM
Multiple Database Connections rit01 ASP.NET 1.x and 2.0 Application Design 6 September 20th, 2006 12:42 PM
Multiple database help keady2 Access VBA 1 April 17th, 2006 03:05 PM
Multiple Database in one report chriskhan2000 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 October 13th, 2004 09:39 AM
Multiple Database query nlicata SQL Language 1 August 15th, 2003 03:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.