Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This does depend rather on your actual requirements.</p> <p>For a simple/sample/prototype winforms app, I'd suggest basic <a href="http://msdn.microsoft.com/en-us/library/aa983610(VS.71).aspx" rel="noreferrer">WinForms Event Handlers</a>, with the code (providing it's not too heavy) in the handler methods. If code is heavy, contains hard business rules and doesn't interact with the form then it's best to move that code to another class and call it from the event handler.</p> <p><a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming" rel="noreferrer">Aspect Oriented Programming</a> takes this futher. It's generally best applied in larger-scale projects. You still need event handlers for your form elements (and I recommend sticking to the control-based event handlers - don't try creating your own global event handling facility), but they should make calls to Command objects (see <a href="http://www.dofactory.com/patterns/patterncommand.aspx" rel="noreferrer">Command Pattern</a> in GangOfFour). Those command objects can then be invoked from anywhere in your application. If you want instrumentation, the instrumentation should be on those Command objects rather than the WinForms events. You can leverage <a href="http://martinfowler.com/articles/injection.html" rel="noreferrer">Inversion of Control</a> containers like <a href="http://www.castleproject.org/container/index.html" rel="noreferrer">Castle Windsor</a> to inject logging/auditing into the commands without having to change your application at all using the <a href="http://www.castleproject.org/container/documentation/trunk/usersguide/interceptors.html" rel="noreferrer">Interceptor pattern</a>. <a href="http://www.davidhayden.com/blog/dave/archive/2007/03/14/CastleWindsorAOPPolicyInjectionApplicationBlock.aspx" rel="noreferrer">Here's an example from David Hayden</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload