Skip Navigation Links / Posts / Post

My Iron Coder solution is up

Categories

Mitch has blogged about his Iron Coder solution for integrating a security mechanism into a project and I'd like to write a few short words about my own solution (which can be found here: http://projectdistributor.net/Releases/Release.aspx?releaseId=215).

As mentioned earlier, Mitch has gone for an extender provider solution while I have chosen something which - while not being from the Gang of Four textbook - closely resembles the observer pattern.  That is, I have a manager class which gains a reference to each of the controls on a form and can then enumerate them and notify them that they need to take some form of action - in this case, they need to apply their security settings.

I only spent about 20 minutes on my solution so my factorings are not quite what they should be (close, but not quite there).  Mine is about where I'd normally leave it for a proof-of-concept or a code prototype - about 80% there probably.

Semantically there is very little difference between what I've come up with and what Mitch has come up with other than that I have sub-classed the controls while Mitch has not.  While this leaves Mitch with a single place to add/remove logic from it also means that he has an ever-growing switch statement at the heart of his logic which needs to cater for each exception to the rule that he comes across.  My rule of thumb is that, whenever I see a large case statement handling cases for types then I have a candidate that is ripe for sub-classing.

The interesting thing in this excercise is to see the different ways that we choose to go about providing solutions.  Given that most of the time (such as this time) there's really no clear winner, it's clear that the way that we choose to lean is normally a reflection of our own biases.  I think that this mentality is much more interesting from the viewpoint of how it impacts decisions within a team environment than it does in a single, on-against-one, combatative environment such as this coding bake-off.  For example, if Mitch and I were working on the same project, how much time do you think that we'd waste making a largely cosmetic decision such as this?   How would we decide which way to go?

posted 7/10/2005 1:38:07 PM

 

Comments:

There are no comments to display for this post.

 

Comments are currently disabled for this post.