April 23, 2017

Framework One: Refactor ColdFusion Code with One File

Web applications make great use of the model view controller (MVC) pattern to build complex usage patterns. The web lends itself really well to the model-view-controller framework because of it’s tiered architecture and views can be easily presented through HTML. Microsoft is pushing the model-view-controller framework in ASP.NET and Java programmers have used the abstraction to great effect. Most platforms and languages have a frameworks that implement the model-view-controller in addition to many other features. ColdFusion is no different. And for awhile now ColdBox has been the forerunner and continues to dominate. It has a great set of tools and excellent documentation, support. A smaller, open source framework exists, that provides full model-view-controller framework with only one file.

The simpler and more lightweight as it is only one file and minimal in any configuration, MVC framework is FW/1 or Framework One. With this one file and some ColdFusion configuration changes, along with following the framework’s minimal conventions, you can decouple your application’s design without being forced into overbearing coding conventions that feel like you are working on another platform and not ColdFusion. FW/1 or Framework One does its best to keep a small profile. By using “request context” structure and simple naming conventions, the Controllers, Services, Views, and Layouts of the framework can be coaxed into hooking together auto-magically or can be wired manually. A so-called subsystems feature of the framework can combine separate codebases that use FW/1 so that you can keep things modularized until reuse.

ColdFusion has many frameworks available, but several features that make the open source FW/1 or Framework One framework so desirable is its minimal footprint. One file, some global configuration changes, and simple naming conventions can keep your code in a more maintainable form, potentially increase the performance, and enable you to add features in a more structured manner. For projects that don’t need the heavy harnesses of other mainstream frameworks, that don’t want the burden of supporting a massive framework, FW/1 brings a lot of power in the smallest of packages.

Taylor Gillespie
About Taylor Gillespie 10 Articles
Taylor is a Staff Writer for DevWebPro