Someone recently pointed out that I have been very enthusiastic about Mach II without actually explaining why I am so enthusiastic about it. At first I didn't believe them - but when I went back and re-read everything I've posted about Mach II, at no point had I really explained why. My initial reaction was that the reasons should be self-evident: I'm a proponent of OO, MVC and structured development so "of course" I would be enthusiastic about Mach II. That's a bit of a cop-out so I'll try to explain myself better.
First off, I'd recommend reading the Mach II FAQ on the official website as that answers some of the basic questions like:
- "Do I need to be an object-oriented expert to use Mach-II?" (no, but some OO knowledge helps)
- "What is MVC, or Model-View-Controller?" (go read the FAQ or visit my Mach II concepts page)
- "What is Mach-II's learning/implementation curve?" (not that hard... really!)
That won't help explain my enthusiasm but it will give you the background for my explanation.
- Why Mach II?
- Mach II is a framework that elegantly implements the MVC design pattern and is based on an Implicit Invocation Architecture. It helps ColdFusion developers build maintainable applications by allowing them to focus separately on the independent parts of their applications: the business model, the presentation layer, the connecting logic - the flow of the application. Mach II encourages developers to structure their applications in a way that enables reuse and supports future requirements changes.
- Hmm, big claims. Why is a framework so important?
- A good framework provide a natural structure on which to build your application. It assists rather than imposes. There are a lot of bad frameworks out there that really force you to do things in an unnatural way and make a lot of compromises in how you build your application. A good framework simply lets you focus on solving the problem in a well-organized manner and provides the leverage to turn your components into an application.
- And Mach II is a good framework?
- Yes, in my opinion it's a very good framework. It's built on very sound engineering principles and is relatively simple (for a framework). If you're already solving problems using ColdFusion Components and trying to apply design patterns, then Mach II will feel natural and not get in the way of your problem-solving.
- Sound engineering principles?
- Yes, the Implicit Invocation Architecture behind Mach II is a clean, simple way to loosely couple components so that control flow can be easily changed if the requirements change. The business model components don't interact with each other directly for the most part - they broadcast events that the controller (Mach II) uses to sequence the flow of the application. This makes the business model components very loosely coupled - they know very little about each other - which makes them easier to build, easier to test and easier to reuse in other applications.
- Implicit Invocation sounds complicated - how does Mach II help make that
easier to use?
- That's the beauty of a good framework - it hides the complexity of
the architecture from the developer. With Mach II, you simply write your
CFCs, have a few of the top-level CFCs extend part of the Mach II framework
(the
Listenercomponent) and then write your views (as plain.cfmfiles). YourListener-derived components can then announce events to change the control flow if they need to, but that's about as much as you need to know in order to get started.
- That's the beauty of a good framework - it hides the complexity of
the architecture from the developer. With Mach II, you simply write your
CFCs, have a few of the top-level CFCs extend part of the Mach II framework
(the
- Have you been this enthusiastic about other frameworks in the past?
- No, actually I haven't. I've used quite a few frameworks over the years and not had particularly good experiences with most of them. Most of them have forced a style of working on me that doesn't match how I naturally solve problems. Mach II is based on MVC which is pretty much how I build my applications by default - it's a much better fit to how I work.
Read more about...
- Official Mach II resources:
- The Mach II FAQ, Documentation and Articles.
- Configuring Mach II (PDF).
- Mach II DTD for the XML configuration file.
- The Mach II forum (on the Fusebox website) - also available as an RSS feed.
- The Mach II ColdFusion mailing list (on the Topica website).
- Resources on macromedia.com:
- Resources on this website:
- Why Mach II?
- Getting started with Mach II.
- The concepts behind Mach II.
- The anatomy of the "ContactManager" sample application.
- Stuff you can download for free!
- Bug fixes & enhancements for Mach II core files (updated 11/5/2004).
- Other Mach II resources:
- Mach-II.info - community FAQ and a more comprehensive sample application.
- Robby L's Mach II page - includes filters and plugins.