whether a dictionary property for data holder business object is goodor not?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • giddy

    whether a dictionary property for data holder business object is goodor not?

    hi,

    yet another design question, this one is more simple and maybe a
    little silly.

    When it comes to classes like

    class Person{
    string Name;
    string Address;
    int Age;
    ....
    }

    They have a bunch of data holding properties, and properties that
    could change over time, I read somewhere that a dictionary would be a
    good thing to replace properties like this, so would a dictionary be
    better?
    A bad thing would be that properties would turn out to be strings! Is
    that ok?

    More importantly, would this help me bind my properties easily when it
    comes to making long annoying forms with a control for each property
    that must be validated. Is there a good design to automate
    validation,upda ting the right property in the business object and
    saving it.


    Thanks so much

    Gideon

  • Ignacio Machin ( .NET/ C# MVP )

    #2
    Re: whether a dictionary property for data holder business object isgood or not?

    On Oct 1, 10:35 am, giddy <gidisr...@gmai l.comwrote:
    hi,
    >
    yet another design question, this one is more simple and maybe a
    little silly.
    >
    When it comes to classes like
    >
    class Person{
    string Name;
    string Address;
    int Age;
    ....
    >
    }
    >
    They have a bunch of data holding properties, and properties that
    could change over time, I read somewhere that a dictionary would be a
    good thing to replace properties like this, so would a dictionary be
    better?
    A bad thing would be that properties would turn out to be strings! Is
    that ok?
    >
    More importantly, would this help me bind my properties easily when it
    comes to making long annoying forms with a control for each property
    that must be validated. Is there a good design to automate
    validation,upda ting the right property in the business object and
    saving it.
    >
    Thanks so much
    >
    Gideon
    If they are replaced very often yes, a dictionary is a good idea.

    I find weird though that a class Person change that often, it might
    indicate a bad design

    Comment

    • giddy

      #3
      Re: whether a dictionary property for data holder business object isgood or not?

      If they are replaced very often yes, a dictionary is a good idea.
      >
      I find weird though that a class Person change that often, it might
      indicate a bad design
      hmm, but there are properties like
      PuposeOfVisit, Country of Birth, State Of Birth, and a bunch of other
      details that the marketing guys could maybe benefit from??

      But more or less they're all just "Data" about the user more than
      properties.

      Thanks
      Gideon

      Comment

      • Ignacio Machin ( .NET/ C# MVP )

        #4
        Re: whether a dictionary property for data holder business object isgood or not?

        On Oct 1, 11:25 am, giddy <gidisr...@gmai l.comwrote:
        If they are replaced very often yes, a dictionary is a good idea.
        >
        I find weird though that a class Person change that often, it might
        indicate a bad design
        >
        hmm, but there are properties like
        PuposeOfVisit, Country of Birth, State Of Birth, and a bunch of other
        details that the marketing guys could maybe benefit from??
        >
        But more or less they're all just "Data" about the user more than
        properties.
        >
        Thanks
        Gideon
        our system has something like that, user Defined Fields. Basically
        they are stored and treated as a dictionary.
        As you saw it's more challanged to create a form to display them. you
        have to design he form to allow it to have an unknown number of fields.

        Comment

        • Jeff Johnson

          #5
          Re: whether a dictionary property for data holder business object is good or not?

          "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin @gmail.comwrote in
          message
          news:9ba64d5e-724e-416e-9f5e-0bd8f00d925f@y7 1g2000hsa.googl egroups.com...
          >hmm, but there are properties like
          >PuposeOfVisi t, Country of Birth, State Of Birth, and a bunch of other
          >details that the marketing guys could maybe benefit from??
          >>
          >But more or less they're all just "Data" about the user more than
          >properties.
          >>
          >Thanks
          >Gideon
          >
          our system has something like that, user Defined Fields. Basically
          they are stored and treated as a dictionary.
          As you saw it's more challanged to create a form to display them. you
          have to design he form to allow it to have an unknown number of fields.
          Grids are very handy for that.


          Comment

          Working...