471,337 Members | 1,122 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

class design problem & databinding


I am facing a design problem here & need your expert design advice on

I have a class called Vendor - which has several simple attributes like
Name, Address etc
Now, each vendor has some attributes - which are not "simple"
Basically, they can be an instance of another class

for eg
Name (string)
ContactPerson (Person)
Name (string)
Phone (string)

Here, VendorName, city comes from 1 table & Contact Person data comes
from another table

What is the ideal way to make sure that I have an object instance
filled up?
i.e. load the data up-front
Vendor v = Utility.GetVendor("111"); //this will query & fill Vendor as
well as ContactPerson info
(constructs the object entirely - even though some properties might not
be read at all)

or query it seperately based on what is needed ?

Now, I need to display Vendor Name, ContactPersonName in some container
using databinding.

If it were look like below, it would be a straight binding

Name (string)
ContactPersonName (string)
ContactPersonPhone (string)
Is the design 1 valid design?
If design 1 is valid, how do I achieve databinding?

Is design 2 valid - as it helps to achieve databinding ?

I hope this is enough to explain the scenario
If not please post it here - so that I can elaborate it


Feb 1 '06 #1
2 1314
Can anybody advice me on this?


Feb 2 '06 #2
Experts please !!!!


Feb 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Richard | last post: by
6 posts views Thread by eye5600 | last post: by
1 post views Thread by Vik | last post: by
2 posts views Thread by Colin Robinson | last post: by
3 posts views Thread by Trammel | last post: by
reply views Thread by Kalpesh | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.