Extender Provider vs. Subclassing Bake-Off

Mitch has replied in our ongoing discussion on the merits of extender providers, and suggested a “code-off” to test out the merits of the two approaches. I think that’s a great idea. Mitch - I’ll let you define the a hypothetical scenario (and maybe some starting code) and we’ll go from there.(note to self: Mitch is going to kick your ass…back out now….back out) And now to continue the discussion:

Mitch says “Sub-classing has one advantage over extender providers in that by using the derived-class you automatically get the modified behaviour when you drag the control onto the design surface for the first time”. I think one of the benefits of sub-classing (if you’ve used that approach from the outset) is that you can make broad changes across your whole application from a single place. While this can be a sharp and useful tool it can also be a good way to cut off your hand (if not used appropriately). If you decide you want to add something with extender providers you have to go and add the provider to all the forms, then set the “extended” properties on all the controls. For applications with hundreds of forms this could be a little annoying. Also (and this is nit-picking a little) debugging “design-time” behavior can sometimes be annoying and a little more tricky than just plain inheritance. Ultimately the decision to use extender providers or subclassing isn’t and exclusive one, you can use either approach where appropriate.

Back to the discussion of a code-off for a minute: Does anybody think this would be a good thing for codecamp OZ next year? I’m thinking something like Iron Chef - “The challenger hails from a small consulting company in <big city>. Noted for their clever use of delegates and encyclopedic knowledge of the System.Data namespace. Who will they face? Will it be Iron Coder VB.NET Mr Bill McCarthy? Iron Coder Integration “Biztalk” Bill Chesnut, or Iron Coder Regex Darren “bracky” Neimke?” I love that crazy “Chairman Kaga” from the Iron Chef show. From his interesting “philosophical” out-pourings at the start of the show to the way he bites into that yellow capsicum and then looks at the camera. I aspire to that level of craziness.
Chairman Kaga biting into an capsicum

Comments

Greg Low
Hi Joseph,

Now that post’s got "blog entry of the week" written all over it but the new week is young as yet…

Regards,

Greg
8/07/2005 3:22:00 AM