MVC is on my mind at the moment. I’ve read more about this and other design patterns and frameworks in the last few weeks than I care to recount (though I do hope it’s starting to sink in).
This is all in preparation for the biggest project I’ve ever tackled.
Now unlike other projects, I’ve stopped myself from just delving in and getting amongst the code.
I’m not sure I like this new approach though. It’s making me feel very stressed after not really having made a “proper” (read: there’s not much code sitting in classes) start on something I thought was going to be a lot easier than it’s turning out to be.
However, during my research (and after a few hands in head moments) I came across a great article that talks about MVC – Removing The Model-View-Controller Straitjacket In particular it discusses the difficulty in defining something which can mean many things to many people in many situations. Malcolm Tredinnick suggests to, “stop saying ‘thing X is (or is not) MVC’. You’re almost certainly fudging at the edges and certainly not making things any clearer.”
He also links to an original document from 1979 that sets out what MVC is. It’s pretty cool to think that the geeks back then were solving the same thing the geeks of today are.
In his summary he also offers some sage advice – “Solve problems and understand solutions in context. Don’t pigeon-hole.” I find that the problem with that advice is until you’ve tried to fit the pidgeons into their holes a few times (which seasoned OOP advocates have), it’s kinda nice to think (possibly foolishly) that they might just fit.
This is pretty much where I’m at at the moment – trying to squeeze whopping great big birds into comparably small holes. Fortunately I’ve got a big rubber MVC-Mallet to bang them in with! And some reassuring words that you shouldn’t feel too worried if things can’t be categorised exactly.
I’ll post more about what I’m doing in the coming weeks, but wanted to mention that I’m using the Mate framework (pronounced Mah-teh). It seems to offer some pretty cool features and some great help and examples on the website. There’s a few caveats with using it though. One of which (and this seems to be a bit of a recurring theme with these types of frameworks) is that certain parts of the application aren’t eligible for compile time type checking. I stumbled upon this today, and was quick to realise where the problem lay – but I’m only a few 100 lines of code in at the moment. I’ll post back when I’ve hit 10,000 lines of code and let you know if I’m still mate’s with Mate.