Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > question of class design wrt databinding

Reply
Thread Tools

question of class design wrt databinding

 
 
Kalpesh
Guest
Posts: n/a
 
      02-02-2006
Hello,

I am facing a design problem here & need your expert design advice on
this.
Scenario:

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
Vendor
Name (string)
ContactPerson (Person)
Name (string)
Phone (string)
City

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

Vendor
Name (string)
ContactPersonName (string)
ContactPersonPhone (string)
City

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

Kalpesh

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Another question wrt storage alignment. qarnos C Programming 3 04-30-2009 10:34 PM
STL design "good" wrt producing code bloat? Tony C++ 48 12-12-2006 01:00 AM
Seeking some help with pointer/array notation wrt class members. brzozo2@uwindsor.ca C++ 2 07-29-2006 12:36 AM
question of class design wrt databinding Kalpesh ASP .Net 0 02-02-2006 01:04 PM
Newcomer question wrt variable scope/namespaces Florian Daniel Otel Python 8 01-18-2006 01:02 PM



Advertisments