Posts

Showing posts from July, 2010

New & Fun vs. Tried & True

I love new technology -- .NET 4.0 and the DLR are a dream come true. I cannot wait to convince other developers of the awesomeness of having IronPython for middleware supported by compiled C# on the backend. But before I go upgrading existing client sites to 4.0, I need to be sure it will work. I just want to see it be successful from start to finish. I am skeptical by nature and want results before jumping in bed with any new tech. Not that I don't think Microsoft did an amazing job with the latest framework -- its just that I'm not as familiar with the "workarounds" that I need to learn for things. And yes, there will be workarounds -- I have yet to see perfection in software ( only a few things come close). From my experience it seems that developers fall into two general categories when faced with new technology decisions. Hopefully they change from one category to another. If you're like me, you change on a project by project basis. New &am

TwoRingBinder - a Custom ASP.NET MVC Model Binder

I haven't posted in a few months. Been busy at work and starting playing WoW (I know -- its awful but its fun). But a few weeks ago I made a Custom ModelBinder -- called TwoRingBinder -- for ASP.NET MVC. Ok, it's not an implementation but rather a class inheriting from DataAnnotationsModelBinder that allows for easier custom Binding methods. I put it on github but will explain how to use it below. Download or check out the meat of the code. Essentially, TwoRingBinder allows you to write Binding Extensions instead of writing your own Custom Model Binder every time you want to do something tricky or different with Model Binding. Example: We have a model called SignUp . SignUp has FirstName, LastName, Origin, IsFemale and FromRoot properties. Only the FirstName and LastName properties will be bound from a form via a ValueProvider; however, we need IsFemale to have a value (assume for a service of some type). Now, we don't want a checkbox on the site for people