I am trying to come up with the best architecture for my system, and have some questions. Maybe I just need a book on OO theory and best practices.
Let's say we have a simple PO system. It stores vendors, POs, PO Line Items, etc.
I have the following classes:
PurchaseOrder (A single PO. Contains POLineItems)
PurchaseOrders (PurchaseOrder collection)
POLineItem (A single PO line item)
POLineItems (POLineItem collection)
Vendor (A single vendor. Contains PurchaseOrders)
Now let's say I want to query all POs for one vendor. I create a vendor object, load all PurchaseOrders and POLineItems. I understand using a DataReader and loading individual objects into a collection object, but what is the optimal way of doing this in a proper n-Tier architecture? It seems to me that I would make several trips from my Biz layer to my Data layer, opening and closing several connections in the process.
Grrr.... the more I think about it, the more overwhelmed I become.