M-V-SEE

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.

(I also just found this great article on similar subject matter over at as3dp.comNo Time for OOP and Design Patterns. Check it out, it’s a ripper!)

Please follow and like us:

3 thoughts on “M-V-SEE”

  1. “It’s pretty cool to think that the geeks back then were solving the same thing the geeks of today are”

    Or pretty sad : ) I mean, if we’ve been solving the same problems for almost 30 years we haven’t moved forwards that much, have we?

    But anyway, I completely agree about disregarding the “pureness” of the implementation. My MVC implementations are very loose. For example, I always give a reference of the model to the view which is very handy for reading its data. I also rarely have more than one view, and that simplifies things a lot too. And if the project is not big, I might skip the controller altogether and embed it into the view. Again, not a pure implementation but helps improve simplicity.

    KISS comes before MVC in my opinion.

    Cheers!

    Juan

    Reply
  2. It’s not so much that we’re solving the same problem, but that we’re using the same technique as back then to do so. That’s what’s cool – to think that in 1979 a solution was found to an abstract problem that is still relevant today.

    Reply
  3. I’ll be keen to see how you’re going. I’ve known a couple of ppl who have recently switched from Cairngorm to Mate, mostly for AIR apps.

    Reply

Leave a Reply to Zarate Cancel reply