Prefernces apply and use cases vary, but FWW, here's what I do:
Tbl_Order
Tbl_OrderItem
OrderService, OrderDAO, Order
OrderItemService, OrderItemDAO, OrderItem
I define the Order has-many composed OrderItems (on OrderID) and if I wanted
to see the total price, date and a list of items for order 12, I just:
Order = OrderService.getByIF("12", "TotalPrice,Date", "Items")
It returns an Order IBO with all of the info including a composed OrderItem
IBO containing all of the items which I can access by calling:
OrderItem = Order.get("OrderItem")
All done automagically using a few hundred lines of generic data mapper code
and a getAssociated() method in the base service method.
Best Wishes,
Peter
On 5/17/07 4:02 PM, "Phillip Senn" <[EMAIL PROTECTED]> wrote:
> I'm trying to ask this in as generic a fashion as I can.
> If you have 1 order with many line items, then that is known as an Order
> Header/Order Detail in many lines of work.
>
>
> Q: If you have an Order Header/Order Detail, what do you name the
> tables?
> 1. OrderHeader, OrderDetail
> 2. tblOrderHeader, tblOrderDetail
> 3. tblOrders, tblOrderDetail
> 4. tblOrder, tblOrderDetail
> 5. lcf_Order, lcf_Purchase (from www.Lynda.com Learning ColdFusion
> class)
>
> But here's the REAL question:
> Q: Let's say you decide upon #4. How do you define the components?
> 1. OrderDAO.cfc, OrderBean.cfc, OrderGateway.cfc, OrderDetailDAO.cfc,
> OrderDetailBean.cfc, OrderDetailGateway.cfc
> (Tables relate directly to components)
>
> 2. OrderDAO.cfc, OrderBean.cfc, OrderGateway.cfc
> (The OrderBean is contains everything known about the Order (Header and
> Detail)
>
>
>
>
> You are subscribed to cfcdev. To unsubscribe, please follow the instructions
> at http://www.cfczone.org/listserv.cfm
>
> CFCDev is supported by:
> Katapult Media, Inc.
> We are cool code geeks looking for fun projects to rock!
> www.katapultmedia.com
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
>
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]