Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Windows Application Design Question

Windows Application Design Question

Scheduled Pinned Locked Moved C#
designquestioncsssysadmin
6 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Austin
    wrote on last edited by
    #1

    Hi Folks, Most of my programming experience has been on the back-end / server side and I am begging to work on a new Windows project at home. As I work through the UI, I often find myself wondering if my approach is efficient or "Good." Most of my concern comes when looking at how the program responds to UI events like button clicks ect. Again, I am on bit of uncertain ground with the UI apps so please bear with me if my questions are a bit off or inaccurate. So on with the questions. Is it best to construct objects and call methods directly in the ui event handling code (i.e. on_Click)? Or should I attempt to decouple it further by using delegates and registering event listeners in some type of worker class? And if I use this approach how would you suggest manipulating a moderately complex set of controls…. Is it wise to make the run-time changes directly from the event handlers or should a worker class again be employed? Again, sorry if these question have been less than informed or asked in the past. Any suggestions are appreciated. Thanks again

    D 1 Reply Last reply
    0
    • C Chris Austin

      Hi Folks, Most of my programming experience has been on the back-end / server side and I am begging to work on a new Windows project at home. As I work through the UI, I often find myself wondering if my approach is efficient or "Good." Most of my concern comes when looking at how the program responds to UI events like button clicks ect. Again, I am on bit of uncertain ground with the UI apps so please bear with me if my questions are a bit off or inaccurate. So on with the questions. Is it best to construct objects and call methods directly in the ui event handling code (i.e. on_Click)? Or should I attempt to decouple it further by using delegates and registering event listeners in some type of worker class? And if I use this approach how would you suggest manipulating a moderately complex set of controls…. Is it wise to make the run-time changes directly from the event handlers or should a worker class again be employed? Again, sorry if these question have been less than informed or asked in the past. Any suggestions are appreciated. Thanks again

      D Offline
      D Offline
      David Stone
      wrote on last edited by
      #2

      I have always coded the creation of objects directly into the event handlers. I think it would be fairly inefficient and complex to create a worker class that does that stuff for you. :) David Stone It seemed similar to someone saying, "Would you like to meet my knife collection?" Ryan Johnston on Elaine's sig

      C 1 Reply Last reply
      0
      • D David Stone

        I have always coded the creation of objects directly into the event handlers. I think it would be fairly inefficient and complex to create a worker class that does that stuff for you. :) David Stone It seemed similar to someone saying, "Would you like to meet my knife collection?" Ryan Johnston on Elaine's sig

        C Offline
        C Offline
        Chris Austin
        wrote on last edited by
        #3

        Thanks for the reply David, The real source of my anxiety comes from having quite a bit of stuff going on in the even handlers (object creation, method calls, and UI componet manipulation)and worring that perhaps I am not following what are considered the best practices. Mabey I'll relax about a little :) Thanks

        D J 2 Replies Last reply
        0
        • C Chris Austin

          Thanks for the reply David, The real source of my anxiety comes from having quite a bit of stuff going on in the even handlers (object creation, method calls, and UI componet manipulation)and worring that perhaps I am not following what are considered the best practices. Mabey I'll relax about a little :) Thanks

          D Offline
          D Offline
          David Stone
          wrote on last edited by
          #4

          Chris Austin wrote: Mabey I'll relax about a little I would. I've done tons of stuff on one button click before. Just remember to try not to interrupt the UI experience though. If you have so much stuff that the UI can't respond to any of the user's movements, then you might want to consider multithreading the app. David Stone But Clinton wasn't a predictable, boring, aging, lying, eloquent, maintainer-of-the-status-quo. He was a predictable, boring-but-trying-to-look-hip, aging-and-fat-but-seemingly-oblivious-to-it, lying-but-in-sadly-blatant-ways, not-eloquent-but-trying-to-make-up-for-it-by-talking-even-more, bringer-in-of-scary-and-potentially-dangerous-new-policies. And there was also Al Gore. It just wasn't *right*. Shog9

          1 Reply Last reply
          0
          • C Chris Austin

            Thanks for the reply David, The real source of my anxiety comes from having quite a bit of stuff going on in the even handlers (object creation, method calls, and UI componet manipulation)and worring that perhaps I am not following what are considered the best practices. Mabey I'll relax about a little :) Thanks

            J Offline
            J Offline
            James T Johnson
            wrote on last edited by
            #5

            May I point you to Joseph M. Newcomer's article "Optimization: Your Worst Enemy", in particular the 5 paragraph section titled "When not to optimize". All of Joe Newcomer's articles deserve a read; but that one really opened my eyes. James "And we are all men; apart from the females." - Colin Davies

            B 1 Reply Last reply
            0
            • J James T Johnson

              May I point you to Joseph M. Newcomer's article "Optimization: Your Worst Enemy", in particular the 5 paragraph section titled "When not to optimize". All of Joe Newcomer's articles deserve a read; but that one really opened my eyes. James "And we are all men; apart from the females." - Colin Davies

              B Offline
              B Offline
              bfarley
              wrote on last edited by
              #6

              Interesting article. While I agree there is little point in optimizing for optimization's sake, the real opportunity here is code reuse. Separating your business logic from the interface makes it easier to reuse the code. One has to weigh the benefits against the added complexity Bill F

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups