views:

50

answers:

2

Scenario:

I am building our order processing system. I have an Order object that will contain a Generics list of Invoice and PurchaseOrder objects. I'm pretty sure that I would include the Customer object within the Order object, but then I wonder how I would access that from within the Invoice/PurchaseOrder objects. It doesn't make sense to have each Inv/PO contain an identical copy of the Customer.

What should I do? Put a copy of the Customer in the Inv and PO and the Order object? Or just in the Order? Or am I making this too difficult?

Thanks!

+1  A: 

What language are you writing in?

In .NET you could have a reference to the same client object from all of the other objects. Not a copy, but a reference to one and the same object. But I can easily imagine that something like that might be impossible due to your business framework.

What are you using?

Vilx-
A: 

Thanks for the response... I'm using VB.NET in ASP.NET. I'm building this from scratch and don't have a lot really built yet, so I'm open to anything. How do I reference one object?

Thanks so much!

EDIT: When I say I don't have a lot built, I mean in terms of order processing. I already have a rather sizeable customer database (and the site has been up and running for years now), but I've been manually processing the orders using Excel and would like to automate it online and provide customers with a way to check the status of their order, download invoices, etc. I have a Customer object built, but the order processing is brand new with nearly zero coding thus far. I just want to get it right the first time.

THANK YOU!!

Jason
It seems to me that you do not understand the basics of objects in .NET. You should learn about "reference types" and "value types". Start here and explore the links about objects in VB.NET:http://msdn.microsoft.com/lv-lv/library/2hkbth2a(en-us).aspx
Vilx-