Sep 29 2006

Model-Glue Bloating, Mach-II Dying, Frameworks Stinking...

Posted by Joe Rinehart at 12:54 AM
13 comments
- Categories: Model-Glue | Reactor | Causing Trouble

Ah, geez. It's been a few months since CFUnited, and everyone seems to be forgetting that us ColdFusion folks are people who get along really well when we're in person (and the bar hasn't run dry). Suddenly, frameworks suck, Model-Glue:Unity is a bloated kitchen-sink framework, and Mach-II is obtuse and maybe it "should be allowed to die a dignified death."

I guess that one of the responsibilities that I've gotten from Model-Glue is to speak up about it as well as frameworks in general when something is said that I feel is wrong.

Mom, please excuse the occaisional profanity. It's been a long day, I'm across the country from Dale and the dog, and I have to fly through O'Hare tomorrow.

So, here's my no-crap $0.02:

Framework's dont suck...

..and for some, they're not a half-bad way to learn things. For others, it's probably not a good idea. I've had some people tell them Model-Glue helped OO "click" because it got them thinking in terms of loose coupling and interfaces. It's also befuddled the hell out of some others.

Do what suits you, but recognize that others may not learn in the same way. Don't evangelize the way you learned as the way everyone else should, and recognize that others may learn in ways that you can't.

I'm one of the kids who couldn't learn to swim until I just jumped into the deep end. Some would drown. I probably never would've gotten over my fear of water, though, if I didn't just jump.

Mach-II isn't a dead duck...

...it's just different from Model-Glue (in MVC comparison). I've moved apps back and forth between the two for fun.

To be frank, if you're used to how J2EE does things, you'll probably like Mach-II more. If you're from ColdFusion or Flash, Model-Glue will probably make more sense. Either way, the differences aren't all that huge.

MVC Framework: not big deal.

Business model it connects to: big deal.

Model-Glue:Unity and "Kitchen Sinks"

Calling Model-Glue:Unity a kitchen sink framework or comparing it to an electric lawnmower with silly attachments is, well, just as silly as an electric lawnmower with a set of silly non-lawn-mowing attachments that doesn't have a beer holder. I mean, come on, if we're going to make crazy metaphors Dr. Phil would be be proud of, don't forget the beer holder.

Seriosuly, though, when Peter's post implied that I'm not giving enough considering to what goes "in" the framework, I took a bit of offense. I doubt it was intentional, and the picture in the CFUnited Flickr pool of us choking each other is a joke.

I've consistently turned down requests to add many features that would be useful to a subset of developers in solving edge-cases more elegantly but not to the Model-Glue community at large. I've had people get stinking mad at me over it, but it's something I've had to repeatedly stand up for. It's not easy to tell people that some code they've written is great for solving their problem but that it just doesn't belong in the framework. I've chosen to have friends get stinking mad at me rather than go against my judgement. It tweaks me that anyone thinks I've taken it likely.

The decision to provide scaffolding and ORM capabilities in Model-Glue:Unity was carefully considered. In the end, the pros simply outweighed the cons. I wrote and tossed three ways of doing it before I found a way that let me do three things:

  1. Remove the tedium from creating basic data layers and master / detail lists
  2. Make sure the generated data layer can be extended and refactored while allowing nondestructive regeneration.
  3. Allow anyone who's used scaffolding/ORM to completely toss the Model-Glue based HTML interface without losing any data or business logic
Even more carefully planned was the architecture behind adding the capabilities, and it's important to understand that scaffolding and ORM were added in a way that introduces no dependencies unless you wish to use them. Which leads us to:

Model-Glue extension vs. Mach-II extension

Peter says that the direction Mach-II is going is "extension through architecture instead of providing everything but the kitchen sink."

It probably wasn't intentional, but this underestimates me as a software designer, and it expresses ignorance of Model-Glue:Unity. The framework does, in fact, provide "extension through architecture."

It's simply doing it better than Mach-II.

Mach-II extension uses a plug-in architecture, requiring developers to use its framework-specific plug-in API.

Model-Glue:Unity has a rewritten core, dependent on an Inversion of Control container implementing the ColdSpring BeanFactory interface as an architectural paradigm for extension.

In other words, Mach-II has a framework-specific extension architecture you've got to learn, while Model-Glue has an extension architecture (ColdSpring) that doesn't even know Model-Glue exists, is an already widely used tool in OO ColdFusion, and is re-usable to provide the extension's service outside of Model-Glue.

In a market where we're going to need to provide the same services to HTML, Flex, and other clients, which do you think is advantageous?

Model-Glue:Unity and ColdSpring Dependencies

The framework creates no ColdSpring dependencies within your application. To claim otherwise is a statement of ignorance concerning ColdSpring: anyone who actually knows ColdSpring knows that no ColdSpring application is, in fact, dependent on ColdSpring. It's a beautifully clever thing when grokked.

If you'd like to get down to brass tacks about the lack of dependency, you could implement your own IoC implementation, meet a few interface requirements, toss ColdSpring out the window, and still run Unity.

In the real world, though, the extent of the ColdSpring requirement is that its files must be on your hard drive. Your applications don't need to know it's even there. Hell, no one on your team but the one who downloads Model-Glue needs to know it exists.

Big dependency, that ColdSpring.

Model-Glue:Unity and Reactor Dependencies

You don't have to even to download Reactor run Unity. It's not needed at all.

If you'd like to do scaffolding and automagic database functions, yes, you'll probably need Reactor.

I say "probably" because all of the Model-Glue code that knows anything about Reactor is isolated into a few specific places, defined via interfaces, and it's "plugged in" via that whole "extension through architecture" bit. It took Sean all of a few hours to re-implement and plug in the two components necessary to get Transfer mostly working (I'm not sure he's gotten around to scaffolding/committing hasMany relationships, but it shouldn't be too rough).

Big dependency, that Reactor.

Your application and its dependency on Model-Glue:Unity

If you create an HTML-based ColdFusion application, and you use a MVC framework, are you now dependent on the framework for that application?

Of course not: the point of the MVC frameworks is that just the HTML-based "client" for the Model/application is dependent on the framework.

Unity doesn't change that at all. You could use scaffolding to create a Widget editor, delete everything but the Model directory, and then use the same data tier in Mach-II.

Create a service wrapping the functionality, expose it as remote, and you've got a Flex application.

Big dependency, that Model-Glue.

Comments

Peter Bell

Peter Bell wrote on 09/29/06 5:54 AM

Hello Joe,

Amazing! It is always great to hear from framework authors the thinking that underpins their architectural decisions as you always learn something from it. Many thanks for the great insights.

And sorry if any of my tweaking has caused any grief - I think there IS a problem with people with no OO experience getting overwhelmed by MG and Mach-II (which calls for more training - not less frameworks), I think that with two great community OO frameworks now in development it is perfectly appropriate to have a rational discussion about the real world implications of the different design choices in each framework to develop useful heuristics for selecting a particular framework for a particular project and I think your post has really progressed that by providing a lot of great insight into the decisions you have made.

I also know that blog posts titled "Optimizing First Order Heuristics for the Efficient Selection of Development Frameworks" don't get read or commented on (you should see the stats on some of my DSL posts - not pretty!), and as I go through and read the comments on Frameworks Sucks I learnt a bunch from everyones input which is certainly the reason I'm blogging. If I knew what I was doing I wouldn't have to keep talking about it!

Best Wishes,
Peter
Peter Bell

Peter Bell wrote on 09/29/06 5:55 AM

One thing that is cool, however. Go look at the adsense links at the bottom of this post. Anyone for a lawnmower?!

lol
Paul Carney

Paul Carney wrote on 09/29/06 8:40 AM

Not only is Joe an amazing architect, but he knows how to use the "right" words in his blog to get some interesting Google ads... :)

Joe - Don't let the monkeys get you down. There are many of them that love to make noise. It's not easy being out on the leading edge where people are struggling to keep up. That uncertainty and fear will cause them to release their doubts through noise that some call "discussion".

I, like others who know you personally, know that you have the intelligence and gumption to push the edge and help us all learn. We are extremely grateful for your efforts, so please remember that we support you during the highs and lows.

Now get back to this side of the country where you belong! :)

Paul
Brian Rinaldi

Brian Rinaldi wrote on 09/29/06 9:29 AM

I just reread Peter's post, and while I get how some may have taken it wrongly, I think his metaphor and such were in response to criticisms of mach ii "not keeping up" and not directed in any derogatory way against Model-Glue. I think his intent was to say that Mach ii is a solid framework even though it doesn't have scaffolding and ORM, and not to say that MG is in any way worse because it does. We can fault Peter for a badly chosen metaphor perhaps, but I really don't think he was mud slinging. He even said that there is no right choice, which is correct despite the ridiculous comments of some.

I am glad that MG:Unity has such strong community support, but going back to the start of this most recent debate flare up, it started when I got a bit tired of the misleading hype presented regarding MG on CF-Talk (and bit Peter involved who chose to stir the pot). To be fair, it wasn't you who was doing any of the hyping...I think things like the "Blog in 9 Minutes" video contributed to it...but much like Peter's post, I don't think that was your intent.

So, I think Peter Farrell would agree with me in saying that Model-Glue is a solid framework and that the choices you have made have taken it in a different direction, but this is a good thing for the CF community...more choices with more differentiation. Which, if we could pause the argument long enough to see it, means we all win.
Luis Matthews

Luis Matthews wrote on 09/29/06 9:58 AM

Saying frameworks suck because some people are not experienced enough to use them yet, is like saying grocery stores suck because some people can't cook.
phill.nacelli

phill.nacelli wrote on 09/29/06 11:01 AM

Adding to the lawn mower analogy, you don't have to buy/use an accessory if you don't want to.. not only that, but there's nothing stopping you from changing the normal blade it comes with to to a mulching blade.

Heh? you say.. what's this guy talking about???? Ok.. my point here is MG comes with some optional features and these are not required for you to use them into your application. It's entirely up to the developer whether or not to implement them. Also, for all those folks that wish the framework had a feature that you requested and that didn't make it into the core, don't forget that it's released under the Lesser GPL, you are free to alter it.. just make sure you do it in a manner that it doesn't isolate you from the upgrade path if you are worried about having access to future versions.

And again for the built in scaffolding and optional hooks to Reactor/Transfer ORM's, my personal choice is to use a code generator for DAOs and Gateways in my development, however that doesn't mean I may not use scaffolding to quickly create a sample prototype if the need arises.

My 2 cents..
Kurt Wiersma

Kurt Wiersma wrote on 09/29/06 11:05 AM

I don't think Peter F's comments were negative again MG:U. I think he was trying to make a point about dependencies and the goals of a framework.

Joe, as you mention Sean wrote a MG:U ORM adaptor for Transfer. Isn't this similar to how if you write a M2 plugin you must us the M2 plugin API?
Peter J. Farrell

Peter J. Farrell wrote on 09/29/06 6:49 PM

Joe, I am a bit troubled that you took my post as an attack against Model-Glue. Really, that was not my intent when writting it - nor did I mean for anybody to take offense from it. I wrote that post on Sept 13th which is now over two weeks ago. The funny thing it's only now that people are making a fuss over it. ;-)

Nonetheless, it was spurred on repeated questions over why Mach-II isn't keeping with the Joneses so to say (i.e. the Joneses being Model-Glue with CS and scaffolds etc.). In my opinion, there's many ways of accomplishing the same effect -- whether your canvas be in food, with paint or with a framework's code. To me, it appears that MG and Mach-II are starting to take difference approaches to how to skin the same cat (i.e. MVC problem). Stating that doesn't mean that either framework does it better than the other -- that depends on the eye of the beholder (I'm implying that, as humans, we're all basised even when we think we're not -- including myself).

Sometimes I think it's easy to forget that we put real time, which could be used to make real money, into developing the frameworks and that there are real people behind the "brand" that is the framework. In the end, what monetary benefit do we get directly from developing the frameworks? Nothing! (Sidebar: maybe a few consulting gigs on this or that -- but I consider that to be indirect from the framework development itself). So I can understand if you felt personally attacked...

In summary, my post was about thinking about dependencies. I think people forget about the future mostly when building an application and that it can be easy to get sucked into the "feature request blackhole." That is more important to us when developing a framework than just an simple application.

I will admit that I would have some concerns about the development cycles of CS and Reactor in the future having some impact of the development cycle of MG because you don't have direct control over those projects. Please don't take that as a dig against MG, because it isn't -- personally I think it's kinda cool that MG uses CS to manage itself. However, I'm just trying to state a fact that development cycles don't always coinside nicely and that I hope future development of MG won't ever be hindered by anything out of your control. (Case in point look at the old version of log4j in CF 7)

Moreover, my post was mostly telling people that, as with anything in life, think for yourself! Be independent! Get smarter! Learn!

In short, please accept my sincerest and humble apologies in regards to any offense in regards to my post. If you don't wish to accept my apologies, I can understand that as well -- however let the record show that trying to mend virtual fences so to say. Honestly, this asyncronise communication (blogging) can un-intended side-effects as seen today...
Jason Daiger

Jason Daiger wrote on 09/29/06 8:39 PM

As Ari from HBO's Entourage would say 'Hug it out fellas!'

And that quote applies to all the folks on both sides of the great framework debate!

It takes thick skin to create something and post it out there for the world to pick apart. All framework authors and contributors should be (and I'm sure are) proud of their work. So I can see were having their worked compared to a Willy Wonka-esk lawn mower might or being told Frameworks suck would hit a nerve.

Keep up the good work folks. Regardless of what the 'framework suck' camp has to say, these frameworks have done and will continue to do wonders for the CF community. And these discussions, however annoying or personal they may seem, will likely lead to further innovation.
Hal Helms

Hal Helms wrote on 09/30/06 1:28 AM

What? Model-Glue has a beer holder? Damn. You're good, Joe, Very, very good. We were thinking about including a built-in crack pipe with the next version of M2 -- sort of leap-frog MG.

As for Peter Bell's "provocative" posts, I'm counting down his fifteen minutes...
Peter Bell

Peter Bell wrote on 09/30/06 5:16 AM

Hi Hal,

Re: the provocative posts, I think I've learnt my lesson, so the fifteen minutes are up. I was just genuinely trying to elicit distinctions from people who'd been there and done that before. It seemed implausible to me that with all of the design decsions and trade offs inherent in a framework you could end up with two quite different OO frameworks (even though both MVC, implicit invocation, etc.) where there would be no differences that would suggest a particular framework as being more appropriate for a given set of use cases.

It also seemed unreasonable to me that deep knowledge of every feature wuld be the only way to distinguish which framework to use for a given case. Humans simplify complex information and come up with workable heuristics (simple rules) for guiding information and I was genuinely trying to get people to share those heuristics as there is STILL not a decent comparitive resource for MG vs. M2 with maybe 20-30 (minor or major) points of distinction and the kinds of use cases and gotchas that would drive selection. That still seems incredible to me.

I had noticed that provocative titles generated more debate and comment and I felt that was a good thing as despite the occasional flames, the debate usually teases out great posts like yours and Seans on the "frameworks sucks" post. Would it honestly have gotten through the clutter if the title had just been "On Learning . . ."?!

I am extremely new to blogging and am still trying to find the right balance. Hopefully I will manage to do so before I piss everyone off.

For anyone who has been offended (I'm guessing by the titles - I think if you read the posts and the comments they are pretty inoffensive), I officially apologize. Re-reading the M2 post, it was meant as a tweak and I can see how with the lack of personal contact it could be read as something else, so sorry for that. As for the controversial titles? Well, there is benefit in raising controversial topics (and there are many more than 15 minutes worth lying unexplored in the ColdFusion world). I will try to do so in a more careful manner in the future.

Apologies again if anyone was offended or hurt - directly or indirectly. I can only say that was not the intent.

Best Wishes,
Peter
Dave Cheslow

Dave Cheslow wrote on 10/13/06 11:49 PM

Hello all,

We used to call them "paradigms"... until the marketers got hold of the phrase. Then we called them "design patterns" ... until the academics beat that to death. Now they are "frameworks"... but that too will go the way of the buggy whip one day. The important thing to me is that the variety of ways that we perceive and organize data to create information is becoming more defined.

To me, there's nothing inherently "better" or "worse" about FB/M2/MGU any more than there is anything inherently "better" or "worse" about C/JAVA/FORTRAN. Heck, I'm doing a very interesting project right now in SAS (remember that one?) and another in .NET v2. They represent and organize the data in very different ways, but both are useful.

As for being able to differentiate suitability by project... I am not sure I could differentiate between .Net and CF for suitability by project. They are just alternatives and the choice is often decided by business forces rather than technical ones.

I currently have 4 sites in FB, one half-baked in M2 and I'm starting 2 in MGU. All three are pushing the envelope in their own way and I love 'em all. Keep up the great work and keep building on each other's ideas... it's all good.

=dave=

P.S. Hi there Hal, long time no see, keeping busy?
Matthew Lesko

Matthew Lesko wrote on 11/03/06 9:44 AM

Joe,

Two thoughts:

1. Open Source frameworks succeed when they have a champion. And Joe, you're doing a great job, screw the naysayers.

2. For people who are wondering what does a "Business Model" really mean, I highly recommend "Domain Driven Design" by Eric Evans.

Good luck with your LLC.

Regards,

Write your comment



(it will not be displayed)