question of class design wrt databinding

Discussion in 'ASP .Net' started by Kalpesh, Feb 2, 2006.

  1. Kalpesh

    Kalpesh Guest

    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
    Kalpesh, Feb 2, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kalpesh
    Replies:
    0
    Views:
    311
    Kalpesh
    Feb 2, 2006
  2. Florian Daniel Otel

    Newcomer question wrt variable scope/namespaces

    Florian Daniel Otel, Jan 13, 2006, in forum: Python
    Replies:
    8
    Views:
    296
    Florian Daniel Otel
    Jan 18, 2006
  3. Replies:
    2
    Views:
    336
  4. Tony
    Replies:
    48
    Views:
    1,132
    Mathias Gaunard
    Dec 12, 2006
  5. qarnos

    Another question wrt storage alignment.

    qarnos, Apr 30, 2009, in forum: C Programming
    Replies:
    3
    Views:
    275
    Eric Sosman
    Apr 30, 2009
Loading...

Share This Page