Help! Difficulty understanding DB -> Object mapping
- From: usenet.news.account@xxxxxxxxx
- Date: 7 May 2005 12:48:26 -0700
Hi I am hoping you cann help.
I have a simple system which allows orders to be created for customers.
I have studied various patterns and the like, and I have the following
data structure in the DB:
Order
=====
Order_ID
Customer_ID
Customer_Address_ID
....
OrderLineItem
=============
Order_ID
Product_ID
Qty
Price
Tax
TotalPrice
I have a number of questions. Is it normal to:
1. Store the full chosen billing and shipping address with the Order,
though the addresses are stored in a separate table?
2. Store the full product details with a Line Item? I currently do not
store the title of the product, just its id.
If I store all of these details in the DB structure, I must still load
them into objects. My problem currently is in loading a customers
order. I dont know where to join the product in the line items to the
actual product descriptions. Do I do a DB join to get the ProductTitle
back, and put the product title in my OrderLineItem object? Or do I get
back the order line items, and do a secondary search for the product
based on its ID, load the product, and associate teh product to the
order obejct? I'm confused, and concerned about performances problem.
Any advice?
..
.
- Follow-Ups:
- Re: Help! Difficulty understanding DB -> Object mapping
- From: H. S. Lahman
- Re: Help! Difficulty understanding DB -> Object mapping
- From: frebe
- Re: Help! Difficulty understanding DB -> Object mapping
- From: Mike Austin
- Re: Help! Difficulty understanding DB -> Object mapping
- Prev by Date: Re: Lahman, how ya doing?
- Next by Date: Re: Lahman, how ya doing?
- Previous by thread: What EMF actually does?
- Next by thread: Re: Help! Difficulty understanding DB -> Object mapping
- Index(es):
Relevant Pages
|