Mach-II - Why Bother?!
If you're a procedural programmer, Fusebox is the obvious framework choice. For OO, you could use Fusebox, but Model Glue rocks. So, why bother with Mach-II and providing all us OO n00bs with a difficult framework choice?! Maybe it should be allowed to die a dignified death :->
Mach-II's approach is a little more flexible, but it is also a little more obtuse for getting up to speed with.
I'm not a big fan of required integration in frameworks, but Unity allows you to ignore ColdSpring and avoid Reactor if you're not yet ready for them. So, why bother with Mach-II at all?
Come on Peter/Matt (et al.) - what am I missing. Enlighten me!





http://www.maestropublishing.com/downloads/Mach-II...
Now that we're past that, here's my two cents:
It's a matter of which you are most comfortable with. Does that mean that Mach-II needs to "die a dignified death"? Hell no. Mach-II is far from obtuse and quite easy to understand once you master the principles behind it and, in turn, the principles behind MVC frameworks in general.
I, personally, came to CF from C++. OO concepts and MVC frameworks are nothing new to me. When CFCs came along, my reaction was "About damn time." Other people who started out in procedural languages (CF 5 and previous included) seem to have a MUCH harder time grasping both OO concepts and the MVC concept. This is part of a greater knowledge gap in the CF community that is the topic for another day.
If you are asking this question, then you should also be asking, "Why use a framework at all?". You are not just questioning if Mach-II should be used, you are questioning if a framework should be used at all. It's all a matter of choosing the tool you are most comfortable with for the job. Am I going to tell you Mach-II is better than Fusebox (well, maybe that one) or Model-Glue? It depends on the comfort level of your programmers with the concepts and the tool that works best for your project. Regardless of which framework you use, your code will be much easier to maintain throughout the life of your application.
It seems to me that the MG implementation of MVC (and specifically the observer implementation) is simpler. That makes it a little less flexible (arguably), so what are the use cases where Mach-II kicks MG ass?
The one thing that drives me nuts is experienced developers saying "it depends". It ALWAYS depends, but if the most experienced amongst us cabn't clearly elucidate the heuristics that drive WHAT it depends upon, what chance do the n00bs have when trying to figure out what framework to use for their next project?!
As for questioning whether a framework should be used at all, see my recent post (http://www.pbell.com/index.cfm/2006/9/13/Framework...). I believe that if you are not ready to invest the (substantial) time required to write a framework optimized for your use case, a community framework is the appropriate way to go.
However, that still doesn't answer the question: which framework to use.
I'm just asking the framework experts to step up and provide meaningful heuristics. I don't think "it depends" will cut it any more and I'm hoping for a fruitful debate about the drivers that would sugget one OO framework over another for a given use case. We shall see . . .
Best Wishes,
Peter
Admittedly, it's comparing Fusebox 4.1, Mach II 1.0.10 and Model-Glue 1.0 but most of the points remain valid.
My point about highly dynamic flows was that very few sites actually need such flows.
@Sean - Yeah, anyone who hasn't downloaded all of your "software" links on top right of your blog should do so now (as long as they don't ask you to justify your performance comments from those one or two slides in the Duck Typing presentation :->). The last time I read that presentation (many months ago), I was pretty new to CF OO so the subtleties between Mach-II and MG eluded me. Rereading, it seems the main highlighted point is the distinction between dynamic controller flows in Mach-II and static flows (with redirects) in MG. Anyone played with both frameworks enough to give some specific examples of the gotchas that each approach provides when you start to build larger real world apps?
@Kola - Probably the best comment. A while ago Joel Spolsky said something similar about languages. The best one is the one your team is familiar with - not the one that happens to have closures or other fancy language features which are nice but not as important as the right team in a language they are comfortable with.
For a while I was wondering if Mach-II was dying off as it was, er, hmmm, REALLY stable (no changes at all :->). Obviously that has changed in the last few months and while I think the FB vs. MG or Mach-II heuristics are pretty clear (MG or Mach-II REQUIRE OO skills so FB is a much smarter choice for procedural or transisioning teams while still having a place for OO development teams who are comfortable with it), but I'd like to tease out any more subtle distinctions from anyone with deep knowledge of both Mach-II and MG because now that both MG and Mach-II are in the wild and supported (Mach-II has a longer track record, but MG 1.1 seems pretty stable from what I can tell) the question of which to use for an organization that doesn have deep experience with either is certainly of interest.
Also Sean I know you are the king of "lets just take this application and port it from framework X to framework Y". Any general hints or heuristics about how to think about your architecture in a way that it would make it quicker and easier to port from Mach-II to MG or vica versa? I know it shouldn't affect your model much and I'm guessing some simple mappings would allow you to port your views fairly quickly, but what about controller logic for a larger site. Any thoughts?!
http://clearsoftware.net/index.cfm?mode=entry&...
I'll probably refrain from further comment as well because, like Brian, I'm getting tired of these sorts of debates. If you design your application correctly you can easily switch from M2 to MG (or vice-versa) with very little trouble, so the decision between frameworks really isn't all that important. Try them both out and choose the one that you think works better for you.
In short, many of these discussions are silly, unnecessarily contentious, and I'll spend my time building apps and working on my framework of choice instead of getting sucked into what in my opinion are rather fruitless debates.
I REALLY wasn't trying to call Mach-II obtuse. I should clarify that I was using a relative term saying "a little more" I should have capitalized the word "LITTLE". I don't think I am the only person who would say they found a LITTLE more of a learning curve with Mach-II. Nothing wrong with that - good things usually take a little more effort (not to build apps - I just think the added flexibility of dynamic flows is a little more conceptual work - in return for additional flexibility - nothing wrong with that).
I still think the discussions are useful (maybe I'm the only one). You say "try both frameworks" and I'm in the process of doing that, but the fact is that once Ive done that and learnt all of the features of both systems it is going to come down to a small set of heuristics I will refine for choosing which framework for which project. I think there is REAL VALUE in discussing those heuristics in a balanced way.
This isn't about lawnmowers (Pete), and MG isn't the one and only true way (Jared). But there IS the confusion that MG:Unity requires you to learn CS and Reactor (which Joe and Sean have clearly covered now) and I could name eight individuals out of eight who found it a little quicker to get going with MG conceptually (although many of them use Mach-II for their projects).
I do understand why n00b questions must get tiresome after a while, but I don't see this as contentious. You and Peter have done an amazing job getting Mach-II back into development, we now have two great OO choices and I think it would be great to have a set of heuristics that you, pete and joe would ALL happily agree to for developers trying to decide which framework to learn first or which to use for a given use case. It may even help both frameworks as I think it would be great if they started to evolve distinct brands and personalities (you may prefer Toyota or Volva, but I think you'd agree that one is "value" and the other is "safety").
It may be too much of a simplification, but what is the Mach-II brand? What is the underlyign philosophy that drives the choices you make when adding or not adding new features and what kind of developers, projects and/or tempraments is it better for?
I guess that's what I'm trying to get. Of course, I think yu're doing more than enough with the podcast, framework and the rest of your community involvement, so I'm not saying you have any responsibility to answer this. I will however keep prodding until I can figure out a brand for both frameworks (or at least a set of heuristics that any reasonable person could agree on - whichever framework they happened to use) and I guess I'll just keep posting my best guesses until I have enough experience or get enough comments from people with experience to be able to write (or point to writings "from the horses mouths") a straightforward guide to the relative strengths and weaknesses of the two frameworks.
Best Wishes,
Peter
It reminds me of a graph I saw a while back concerning open source software. The number of people who will spend endless hours blathering on about why open source is good or bad is huge. The number of people actually putting their money where their mouth is and writing OSS or contributing to open source projects is miniscule. The parallel here in my mind is I think there's a huge amount of damage discussions like this can do to people who haven't tried either framework when they see "Mach-II: Why Bother?" and don't go any further, or listen to a moew vocal side of an argument, no matter how incorrect it is. That's the sort of stuff I simply don't have time for.
I appreciate the question concerning Mach-II's brand, although if MG's brand (given the name and discussion I'm assuming this is correct) is "Unity," meaning integration with CS and Reactor, then as we've said, Mach-II's brand would be that we are going to continue to focus on creating an excellent, highly proven MVC framework that allows easy integration with any other framework you want to use if you choose to do so.
Branding, however, is probably too high level to get to your point concerning heuristics, and more important your distinction between Toyota and Volvo. I would argue the distinction between M2 and MG is probably more the distinction between Honda and Toyota. By that I mean you really have to look at the finer-level details if you truly want to see the difference between the two. So at some level the burden is on indiviudal developers to spend some time looking at each before intelligent discussions can be made.
Remember that although M2 has been around for a while, it's still a pretty young framework, and it's only with the latest MG that the distinctions between the two have become more stark. We have a lot of ideas for new M2 features and have a bit of a roadmap sketched out in our heads as to where we want things to go, so the "branding" will become more apparent over the coming months.
This gets back to the OSS discussion I made earlier, however. If people think M2 is lacking features or it's unnecessarily (key word in this sentence!) difficult, we want to hear about that, and better still, get involved with the project(s) if you think you can help. I just get the impression that people spend an awful lot of time talking about such high-level and ill-informed things as to make them rather pointless.
Finally, I think it's interesting that the people who use (or just like to participate in the discussions about) the frameworks seem to have more divided views than the authors and contributors to the frameworks themselves do. I think Joe's a great guy, I respect him, and I agree with a great deal of what he said in his latest blog post about all of this. M2 and MG were amazingly similar for quite some time, so right now in the evolutionary path it might seem difficult to distinguish. For me, I find M2 more straight-forward to use, therefore I prefer it. Maybe it's my Java background, maybe it's just how I think, who knows.
Point is we have choices and we're all maturing as a community far more than we would have had Ben, Hal, Joe, and everyone else who's contributed to these two frameworks over the years not taken the time to push the envelope in CF. My only hope is that we can continue to grow as a community and have intelligent, informed discussions about these issues rather than inflammatory ones that lack substance.
I've worked with both frameworks . I began using MachII when it was a requirement on a large project at a previous employer. I certainly felt the pain of the learning curve myself though I can't truely blame MachII.
While I had considerable CF experience, I had never used any OO principles nor cfcs for that matter. So it all sort of hit me at once. The old ways of solving problems just didn't fit in CFC land.
After a month or two, I started really getting the feel of MachII and becoming productive. I felt at times that the nomenclature behind MachII was a little cumbersome, but then again, the terms weren't made up terms, rather part of the accepted lexicon in computer science.
Months later, when I picked up ModelGlue, it was a snap.
The MG framework seems simpler, for sure but my experience with Model Glue was long after going through the growth pains of OO CF, Components, CF 6.1 wierd bugs... so I am a little tainted.
Both work well as MVC frameworks. Personally, I am framework agnostic. I like all Frameworks. Learning to solve problems within differing contexts is interesting to me and I don't feel as if there is a certain line to stand on. Many seem to be politically on the side of ModelGlue these days so I'll just mention a few of the MachII features I really like.
The MachII framework essentially allows commands to be configured in an XML file. There are stock commands like notify, view, event-arg and the like. You can arrange the commands as suits your application. There are also custom commands in MachII. There are two main flavors of custom commands, Plugins and FIlters
Plugins
MachII has the notion of an Application Wide Plugin. If you have logic that should be implemented across your entire application, MachII plugins offer access to 6 distinct states of the application request flow. Very extensible indeed. I implemented the logic for the ajaxCFC + MachII integration using a plugin.
Filters
MachII If you have logic that should be implemented inside of an event-handler, the notion of a Filter is used. A filter is a custom command insertable anywhere inside an event-handler. an example of a filter is the FormBeanFilter. This filter grabs a bean from memory, runs the validation and returns the results.
As you can see, there is great extensibility in MachII. You can add whole chunks of functionality to an application by the addition of a single line of XML.
I would think this would be of interest to your application generation cause as you can cleanly modify the functionality using the very cleanly implemented extensible points of MachII.
Dan Wilson
B0ll0ck5 ;)
Many thanks for the detailed, thoughtful response. Firstly, your point about the title (and some previous titles) is well taken. I am still a complete n00b at blogging and am not sure how to handle titles. The truth is that the contentious titles get WAY more comments and I only learn when I'm listening (to comments), not speaking (writing posts), so I'm probably going to keep them up but I will see . . .
While I took a little heat for Frameworks Sucks, I also learnt from some great posts by Hal, Sean and others. While this title is probably also not popular with some good friends, I think it helped (along with Petes lawnmower response to my last such posting) to get a great comment and then post from Joe and now a great and thoughtful comment from yourself.
The only thing I promise is that I'll try to follow up with some more moderate and thoughtful posts as I learn more about the heuristics people use when selecting a framework for a project. Of course, the only problem is that nobody will read them as the titles will be too boring :-> (If you look at my blog you'll see the majority of the titles are fairly sedate or yawn inducing!!!)
I tend to agree that "branding" is a little optimistic. It would be easy to brand MG as "the quick fix" and Mach-II as "the enterprise choice", but as Joe pointed out, MG isn't just the scaffolding, and as you pointed out, Mach-II isn't that hard! Each framework supports a wide range of use cases which defy easy branding (and given you don't have to sell them in a 30 second slot, that is perfectly OK).
I agree that it is the responsibility of developers to put the time into choosing the right framework. I also know many smart people have already done that and I can't beieve that none of them noticed that certain classes of problems (other than just dynamic vs. static control flows) might more easily be solved by the collection of metaphors and abstractions selected by one of the frameworks. The challenge is that many people don't examine their heuristics, using general "this just feels the right way", and it often takes some prodding to elicit the remarkably simple rules we all actually use to make sense of the world and make decent decisions quickly. So I'm just off heuristic hunting right now to shorten my learning curve.
I also look forward to informed debate. The only point I would make is that I feel some of inflammatory headlines (followed with more balanced discussion) have actually done a very good job of teasing out great distinctions from very smart and busy people like yourself, pete, joe and many others and I feel that has a place in helping the community to continue to evolve.
Here is to contentious titles and reasoned debate. Let's see if the two can co-exist! (If not, the titles will go).
Best Wishes,
Peter
Thanks for the posting! I think most people are going to be tainted. M2 had the disadvantage of being first so I think a lot of the learning curve issues people had with M2 were to do with OO and DI/IoC rather than the M2 implementation.
Interesting you should mention M2 and the application generator as I'm just about to start on a project to create an application generator for generating M2 apps and I am VERY excited. When you write a generator for a framework you get a very deep understanding of the core features, so I'm hoping to be pretty M2 savvy this year. Now I just need someone else to pay me to write an app generator for generating MG apps, although as I go through I may try to write a generator that is architecturally agnostic between the frameworks so the metadata would work either way and I'd just have to create a few new templates to change frameworks. We'll see!!!
Please send me some sort of source material on where I said that ModelGlue "is the one true way". I said in a comment on Peter F's blog that MG runs faster, is easier to learn and to work with, and does the same job as M2 with less clutter and fewer objects.
No where did I say M2 has no value, should go away, "die a dignified death" or is in any way unworthy... nor did I say that MG was the "one true way". In the context of that article, was I was pointing out was that his comparison was flawed and his arguments were absurd to the extreme and if he REALLY wanted to go toe-to-toe with MG he was going to have a hard time on technical ground or performance...
Aside from that, Joe is one of my very good friends and I have a LOT more experience with MG than I do with M2, so I mildly resent the assertion that I'm promoting the "1TW" approach to things here. If you're going to make the assertion, can you please provide some sort of citations?
Jeesh, sorry if you resented the assertion. You know from when we chatted at cf.objective() that I've got a bunch of respect for you. You are extremely involved and add real value to the community. As for a citation, your comment was (cut and paste below):
"It gets harder and harder to be fair and open minded in a conversation about Mach-II vs MG because MG IS easier to learn, IS faster to develop with, DOES perform better than the equivalent Mach-II application, and the people that develop it are more open to new and interesting ideas and techniques."
You didn't say MG was the one true way, but you did say it was easier to learn, faster to develop with and more performant that M2 - right before suggestion that Joe was more open to new and interesting ideas. I'm not going to take a position on any of the assertions - I'm not knowledgeable enough to do so (which was why I raised this - to get some more detaled heristics as to the use cases that would drive the selection of a given framework for a given project type). I want you to be able to set the record straight right now. Given that MG isn't the one true way, what ARE the benefits of using what you say is the harder to learn, slower to develop, less performant framework? In general terms, when would you recommend M2 over MG? Any heuristics appreciated!
Best Wishes,
Peter
Last exchange with Jared convinces me. I'VE had enough of these framework posts. I'm just going to get back to application generation and design patterns and if I happen to come across any good heuristics for selecting a given framework for a given use case I'll post it with a nice sedate title.
I'll keep the controversial titles coming, but not on frameworks. Not worth the animus (which was soo not what I was aiming for). Especially as the people I'm pissing off (on every side of the debate) are the ones I've learnt the most from and respect the most.
Best Wishes,
Peter
Sorry for misunderstanding... I work really hard to avoid 1TW so you sort of poked in a sore spot. I used to be VERY guilty of it, and I've worked a long time to overcome it as far as I have... and though I'm probably guilty of it at some point anyway, my comments on PJF's blog had nothing to do with that and everything to do with taking oblique potshots at something that obviously didn't get a fair review. So it wasn't "MG:U is better than M2" but it WAS "If you're going to say anything, say something legitimate, and if you can prove me wrong on points x, y, and z, then do so instead of smearing your 'competition'".
As Sean said in a comment on one of these blogs somewhere (might have been on your frameworks suck post), Mach-II is immediately more familiar to folks with certain backgrounds... so it's an ideal fit for the environment. I would never encourage someone with a large base of M2 applications to choose to switch (in fact I'd discourage them!)
I can't really go beyond "This is how MG works and this is how M2 works" without getting into personal preferences, and when it comes to those, especially with MG:Unity vs M2, MG:U wins, even without the added benefits of built-in template generation, generic data messages and ORM integration, simply because the object model used to accomplish the job is simpler, the framework is tuned to be blistering fast, the XML accomplishes the same task with fewer tags and it's easier to understand.
Keep in mind, though, that if someone has put in the time to learn M2 and DOESN'T know MG:U, they're going to be far more productive in M2 than anything else simply because they know how to use it... no different that someone who knows J2EE and doesn't know CF will still be more productive even though they have to work a bit harder to accomplish pretty much the same thing. I'd encourage someone who knows MG:U to take Mach-II for a test drive, see what they think. I honestly don't care how big the userbase of either is, I just know what works best for me and what I can see from community conversations.
You HAD to know this was going to be a harsh topic, man... are you really surprised that you're getting strongly worded comments from people? I mean, these are people's babies we're taking about here, yanno? Just keep that in mind... some things are a matter of religious fervor for people and to be honest, what's been said here has been polite and considerate compared to things I've seen happen on lists and in forums. :)
Laterz (and no harm done, eh?),
J
No harm done - for sure! I guess it was a little optimistic. I was hoping to get Joe to highlight where he felt his design decisions would be less good than M2 for certain classes of use case (the trade offs we all make when deciding what variability to support and how to implement it) and Peter and Matt to highlight the weaknesses in M2 for certain other use cases so that over tea and crumpets we could all suggest that while learning both frameworks was ideal, for application x, we all agreed that MG would have benefits and for application y, we all agreed M2 would be a better choice.
Oh well, at least no blood was spilled :->
Best Wishes,
Peter
So, can we end this now?
Really I'm trying here and I'm sorry that people felt that my post was taking personal digs at MG or Joe or anybody else that I'm not aware of. Honestly, the whole "framework debate" needs a rest and I'm personally tired of debating the same stuff over and over.
Ok, time to get back to work people! Less debating and more framework coding otherwise we're never get new versions out!
Frankly, at least with the requirements of the small pilot app we built, there wasn't all that much difference between the two frameworks, so we couldn't rely on any kind of "feature list" to help us choose . We then turned to our simple intuition to be the tie breaker; ie, which one "felt more natural" to our style. Not such a scientific way to choose a framework, but without a doubt a perfectly legitimate approach.
Having taken the time to taste test both left no doubt in any of our minds which direction we wanted to go. I HIGHLY recommend those standing at the same crossroads take the same approach since, as has been observed, there aren't really all that many gaping differences between them (at least from where Im standing). Choose the one that tastes better.
Just my two cents.