winforms design suggestions / help

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

    #1

    winforms design suggestions / help

    Hello, I'm working on a winforms app that will be used in stores in
    different states and each state can have different data capture
    requirements. I want to create a base form for for all the common
    data and wish to use visual inheritance to subclass the different
    forms that need to capture specific data for each state - but I don't
    want to have 50 different subclasses. And I don't want to have a huge
    IF statement saying IF NY activate this field, IF FL activate that
    field, etc.

    Any suggestions on the best way to go about doing this would be
    appreciated.

    TIA
    G
  • Cowboy \(Gregory A. Beamer\)

    #2
    Re: winforms design suggestions / help

    You need to do some analysis on the needs and find the common points. You
    will likely find you can work either with a few subclasses, as states group,
    or with groups of classes attached to the main class.

    If your business does not give time for analysis, you can start with 50
    classes and refactor down. If you business will not give time for
    refactoring, you are in trouble.

    As for the UI, you can create a more dynamic UI that reads the classes, so
    you do not need 50 UIs.

    BTW, this is always a pain.

    The other method is to set up custom fields that can store any old crap you
    want. This is common with configurable systems. I would rather do the
    analysis and add a few custom fields for the business than adopt this
    methodology.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog


    or just read it:


    *************** *************** **************
    | Think outside the box! |
    *************** *************** **************
    "GiJeet" <gijeet@yahoo.c omwrote in message
    news:15f13ff0-341a-467a-9a5b-3b67046b1b90@d7 0g2000hsc.googl egroups.com...
    Hello, I'm working on a winforms app that will be used in stores in
    different states and each state can have different data capture
    requirements. I want to create a base form for for all the common
    data and wish to use visual inheritance to subclass the different
    forms that need to capture specific data for each state - but I don't
    want to have 50 different subclasses. And I don't want to have a huge
    IF statement saying IF NY activate this field, IF FL activate that
    field, etc.
    >
    Any suggestions on the best way to go about doing this would be
    appreciated.
    >
    TIA
    G

    Comment

    • GiJeet

      #3
      Re: winforms design suggestions / help

      >On Sep 26, 5:50 pm, "Cowboy \(Gregory A. Beamer\)" <NoSpamMgbwo... @comcast.netNoS pamMwrote:
      >As for the UI, you can create a more dynamic UI that reads the classes, so
      >you do not need 50 UIs.
      Cowboy, when you say "dynamic UI" do you mean build the form on the
      fly at runtime?


      Comment

      • OD

        #4
        Re: winforms design suggestions / help

        >On Sep 26, 5:50 pm, "Cowboy \(Gregory A. Beamer\)"
        ><NoSpamMgbwo.. .@comcast.netNo SpamMwrote:
        >
        >As for the UI, you can create a more dynamic UI that reads the classes, so
        >you do not need 50 UIs.
        >
        Cowboy, when you say "dynamic UI" do you mean build the form on the
        fly at runtime?
        I think that's what he was meaning. And I think it's a good approach
        for the kind of problem you're speaking.
        You can base your code on small user controls, each one doing a
        specific data capture. The form is built at runtime using those
        controls. The form layout can be stored in an xml file, each user
        having its own one.

        --


        OD___
        Des systèmes .NET solides. Une IA utile, fiable et maîtrisée : audit, architecture, modernisation et mise en œuvre.



        Comment

        • GiJeet

          #5
          Re: winforms design suggestions / help

          >On Sep 27, 1:57 pm, OD <webmaster @ e-naxos dot comwrote:
          I think that's what he was meaning. And I think it's a good approach
          for the kind of problem you're speaking.
          You can base your code on small user controls, each one doing a
          specific data capture. The form is built at runtime using those
          controls. The form layout can be stored in an xml file, each user
          having its own one.
          Seems like a good idea but maybe a little too advanced for me. Is
          there any code or examples anywhere that I can read and follow?

          TIA
          G

          Comment

          • OD

            #6
            Re: winforms design suggestions / help

            Seems like a good idea but maybe a little too advanced for me. Is
            there any code or examples anywhere that I can read and follow?
            I do not know if there's a full tutor on this subject on the web, you
            can try google of course.
            But this is not very difficult. In VS it is very simple to build a user
            control, so just try to build one to understand the process (and you'll
            find a lot of tutors about building user controls on the web).
            Once you know how to write a UC, you can write tons of them..
            Then, it is not very difficult to read an XML file containing a form
            layout, each entry will have the class name of the control and the X,Y
            position. A simple loop that creates each UC on the fly will make the
            job.
            Of course, all depends on your skill. As we can't write the code for
            you, the best is trying to write it by yourself and come here again and
            again if needed with some precise questions and will try to help each
            time...

            --


            OD___
            Des systèmes .NET solides. Une IA utile, fiable et maîtrisée : audit, architecture, modernisation et mise en œuvre.



            Comment

            • GiJeet

              #7
              Re: winforms design suggestions / help

              >On Sep 28, 10:47 am, OD <webmaster @ e-naxos dot comwrote:
              Seems like a good idea but maybe a little too advanced for me.  Is
              there any code or examples anywhere that I can read and follow?
              >
              I do not know if there's a full tutor on this subject on the web, you
              can try google of course.
              But this is not very difficult. In VS it is very simple to build a user
              control, so just try to build one to understand the process (and you'll
              find a lot of tutors about building user controls on the web).
              Once you know how to write a UC, you can write tons of them..
              Then, it is not very difficult to read an XML file containing a form
              layout, each entry will have the class name of the control and the X,Y
              position. A simple loop that creates each UC on the fly will make the
              job.
              Of course, all depends on your skill. As we can't write the code for
              you, the best is trying to write it by yourself and come here again and
              again if needed with some precise questions and will try to help each
              time...
              OD, I don't think I'd have trouble with the code itself, just trying
              to get the whole concept in my head. So, you use a User Control that
              contains code that reads an xml file that describes the form layout?
              I guess I'm not following how that works. Is there a name to this
              concept that I can google? Or better yet, if you could send me a few
              links to follow that would be great. Thanks!!
              G

              Comment

              Working...