Pattern for wiring up events using jQuery
<p>Please look at the code at the end to see the method I've been using to wire up events in my jQuery code. I prefer using bind and as you can also see I don't like using Anonymous functions in my event handlers. </p>

<p>I'm using named functions because of the following two reasons:</p>

<ol>
<li>Readability</li>
<li>Multiple calls to my WireUpGlobalCommandClickEvents will not add multiple event handlers to the click of my link.</li>
</ol>

<p>This has a side effect - I need to pass in data to the OnAddNewSnippetClick using bind's functionality, since in OnAddNewSnippetClick, this now refers to the element that caused the event to fire.</p>

<p>I've always treated JavaScript as a second-class citizen and as you can see I'm trying to force the conventions I use in my ASP.NET MVC application onto my JavaScript here as well. Is my paranoia about multiple event handlers being added misplaced? Is there a better pattern to wire up event handlers using jQuery?</p>

<pre><code>SettingsController.prototype = {

    OnAddNewSnippetClick: function(event) {
        event.data.SettingsController.SettingsAjaxHelper.AddNewSnippet(event.data.Parameter, event.data.SettingsController);
    },

    WireUpGlobalCommandClickEvents: function(parameter) {
        $('#addSnippetLink').bind("click", { SettingsController: this, Parameter: parameter }, this.OnAddNewSnippetClick);
    }
};
</code></pre>
