Windows Application Design Question
-
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
-
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
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
-
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
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
-
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
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
-
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
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
-
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
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