This is a rant that has been building in me for a while. This is probably going to be a bit raw as a result.
I’ve seen a lot of talk about MVC in Flex/ActionScript circles over the last year or so and wish I had voiced my opinion a little earlier, so I apologize if the timing of this seems misplaced.
I’ll start with the particular impetus for writing this article (from an article today on InsideRIA):
The biggest problem facing Cairngorm is the apparent lack of documentation. It can be argued that Cairngorm is a highly flexible architecture that is poorly represented by a few meagre examples.
Counter argument here would be that the biggest problem for a framework like Cairngorm is not the lack of documentation; it’s the fact that the documentation that exists advocates design patterns and code behaviors that would make a seasoned developer cry. Frameworks like this cause too many developers to stop thinking about their code design.
There are situations where a pattern such as MVC should be followed, it helps your code flow and everything runs smoother, but I get the sense that there are far fewer developers who question why they are doing MVC than there should be.
How many question “Is this a good use case for MVC?” or are you just coding that way cause thats the only way to cram it into your classes? I see too many developers get stuck in cookie-cutter solutions: singletons, reinvented event management, 100s of files of boilerplate code. What became of good software architecture?
My attitude these days is that I’ll use whatever is good for the job and stays the hell out of my way when I do it and doesn’t make me fight the framework when I try to implement a modified architecture. There is one particular framework that does this for me for now, until something better comes along.
I’d love to hear others opinions on this as well.
To answer your hypotheticals, not many, hence the popularity of frameworks. It’s easier to build on a foundation that gives you a semblance of scalability. That, and it allows you to work with mid to junior developers on a multi-person team. Yes, it’s sad everyone isn’t learning design patterns, and their variety of implementations, as well as the why.. but that’s just the way it is. We have the resources we have, and move forward.
Regarding framworks… nice try, you first. What framework stays out of your way?
@JesterXL: My question on opinions was supposed to be directed to the topic in general. I didn’t exactly want to drag a this vs. that discussion into the mix.
But since you asked so kindly…
Personally, I’ve found Mate to stay out of my way the most in a variety of ways. I’m not entirely a fan of the MXML based event handling, but it has suited me recently and I tend to keep the Mate-specific code to <5% of the actual code base, whereas other frameworks have a much higher rate of infection.
Sounds familiar to what others say. There are 3 camps: those who think frameworks are dumb, those who like Mate, and everyone else. That is a great simplification, but an accurate one if you follow anyone in the Flex community on blogs & Twitter. A lot of the people who get sick of “get the heck out of my way” like Mate, and sight the same lack of strong-typing reasons you do. Nothing but statements, I know, but just some confirmation others agree with your sentiment (some of those in the Mate camp).
there are frameworks and frameworks, I consider all MVC frameworks as architectural (or structural) frameworks, eg. they impose a structure on you and what kill me the most is that many developers can not even start a project without throwing their favorite MVC framework as the base, which imho is wrong.
So yeah any MVC frameworks will get in my way.
What does not get in my way is application frameworks, and I got one example here
http://code.google.com/p/maashaack/ (I am one of the contributors so maybe I m biased).
But this project above is what I expect from a framework
* do not impose a structure on me
* try to standardize basic stuff via interfaces
* I can use 1% , or 10% or more of it and it does not force me to change the design of my code
So, all frameworks are beneath you, but you use Mate? Why? Also, I fail to see how good software architecture and frameworks are mutually exclusive.
Is it time for the “I’m the superior craftsman and everyone else is a framework drone” post of the week? Why do these posts never include any examples, just vague, wiser-than-thou gestures towards “good software architecture”?
A seasoned developer should be able to apply various flavors of MVC–or not–to the situation at hand…and a seasoned developer should also know that reinventing the wheel isn’t necessarily a good use of her time. MVC has been around for 40 or so years because it offers a practical, beneficial way to divvy up functionality.
Clearly the last two of you missed my point entirely. I don’t advocate a particular framework or disregard MVC completely. I guess you could boil my argument down to: don’t blindly follow the docs and best practices.
@ Matt: Did you miss my first sentence? Don’t like a rant, don’t read a rant.
However, I’ll you bring up an excellent point about not posting examples. It was unfair of me to complain without posting a solution. I guess would call such a thing a rant. I digress.
I’ll take it as a challenge to give some examples.
Your restatement sounds alright to me. I’ll restate, too: Frameworks are often a cheap and effective way to do best-practice programming.
What I do dislike about frameworks is just all the framework talk. MVC frameworks are (and should be) boring. Comparing them is about as exciting as comparing a while loop and a for loop. It’s all pretty much variations on a theme: some kind of messaging system, some kind command registering, etc. This kind of plumbing is nowhere near as interesting as the domain logic of an application, which can encompass anything from avatars to mortgage payments. That’s what gets me out of the bed in the morning, anyway, not Mate v. Cairngorm.
As for keeping frameworks flexible rather than rote…maybe. But being a huge fan of Rails, I suspect more flexibility isn’t what most Flex developers need. For myself, I don’t need to write/generate/configure/inject another delegate class, ever. Who cares? I’ll take a strong convention over this paperwork-heavy freedom anyday. These wonderful Java people are turning Flex into another imperial bureaucracy.
That’s my mini-rant, anyway–sorry to hijack yours.
So, really your problem is with the developers “blindly” using the frameworks, not with the frameworks themselves. I understand that point of view. In my own case, the first framework I ever used was ARP, and since it was made clear that that framework was based on design patterns (which frightened and confused me at the time), I learned about them before digging into the framework…that was (and still is) invaluable to my growth as a developer. The title of the post though, says something completely different.