The simplest thing that could possibly work - My Iron Coder Entry is up on Project Distributor

My entry into our little “Iron Coder” competition is up on Project Distributor. After Darren's entry explored the observer pattern with a nicely factored interface for “secure” controls I thought there wasn't much left for me to say in that direction. Instead I tried to do the simplest thing that would work - sub-classing the tab-page control, adding a roles property and ensuring the tab-page was not displayed (by removing it form the parent tabstrip's tabpages collection). This resulted in some pretty compact (but ugly) code. I then added a “secure button” control (which was much more straightforward, and helped me to factor out the common role-checking code) to show that the tab-strip is a more-complicated-than-usual case because it does not properly honour the visible property. In a real project I think I'd create an interface like Darren did, but it was un-necessary for this simple example. “Chairman” Mitch says once I post this we can move on to the next round - whatever that is. I wonder if he will be able to get a japanese starlet, a writer and a food critic to review our code (ala Iron Chef)?
Comments are closed

Recent Tweets

Twitter May 22, 05:47
Listening to 'thus spake Zarathustra' in a loop all day. Everything seems way more epic.

Twitter May 17, 05:39
Why use add/edit/delete in your doco when you can use append, amend and annul. #whatcouldgowrong

Twitter May 15, 15:25
From the dark heart of the enterprise comes biztalk.js

Twitter May 15, 15:21
http://t.co/eMfOSWJ5gH good story

Twitter May 14, 08:33
Digital certs issued by Bruce schneier aren't identified by digital thumb print, they're identified by digital bite marks. #4yearoldjoke

@josephcooney

Latest Tool - logEnvy

logEnvy is the latest tool I've been working on for searching, sorting and filtering windows and IIS logs, and it's sexy! For more info check it out here.