A common statement I have heard from proponents of ColdFusion frameworks, is that because it is usually easy to maintain a site built in a framework, it is also true that a site not built in a framework is hard to maintain. For those that don’t know, some popular frameworks in the ColdFusion world are Fusebox, Model-Glue, and Mach-II.Here are some facts:
- There are a lot of procedurally written sites out there that are very difficult to maintain
- There are a lot of coders that don’t know Object Oriented principles
- Frameworks help people that are identified by numbers 1 and 2 (as well as other people, of course)
So, taken the above facts, can we then assume that if one doesn’t use a framework, it is impossible to write scalable, reusable, maintainable code?Well, I tried to prove in a previous post that you don’t have to learn a framework to be Advanced. And likewise, I’m going to try to prove that you don’t have to use a framework to write maintainable code. If you already know Object Oriented principles, you can use a combination of cfinvoke, cffunction, CFCs, cfobject, and a few other built-in tags and functions to apply this knowledge. And, if you properly document your code, it won’t be too difficult for a subsequent developer to get up to speed on your site. It is possible to separate your presentation from your logic using plain CF code. It is possible to build safe, secure, portable objects using plain old CF. It is also possible to use encapsulation, abstraction, inheritance, and other OO concepts.All this said, I do think frameworks are filling a big need in the CF community. I’m definitely not trying to discourage anyone from learning a framework. I just don’t believe that framework developers and users have exclusive rights to Object Oriented code. However, I’m pretty much on the fence as to whether or not I’ll learn and use a framework. I’ve played with Model-Glue, but there are still a few things I’m not comfortable with in the CF frameworks available today. But that’s another blog post.