You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion

ColdFusion: Article

Frameworks, Frameworks, Frameworks

Why you should use a framework - Part 1

Your boss tells you that he wants you to build a ColdFusion application based on his requirements, which will take you about a month to complete. You are now faced with two options, you can either start coding your application in spaghetti code fashion, or you can explore the many frameworks ColdFusion offers and choose one of them.

Writing spaghetti code for many is an easy solution, by approaching the application development with a top-to-bottom declaration of code. Using the spaghetti code method will seem logical at first but you'll soon realize that there's so much code you'll be lost debugging the program for months. A framework for ColdFusion is just like books with a table of contents at the front and an index at the back. Because this pattern is always used, anyone who uses the book knows how to access information they need from that book, so frameworks have the same pattern for universal use. Using a framework(s) is the way to go because it will cut your development time, give you better productivity as well as increased code reusability, and help you organize your code and make it easier for future enhancements.

There is nevertheless a lot of contradiction as to whether frameworks are needed. The main argument on the flip side of the coin is that the learning curve for any frameworks is steep. Well, there is quite a challenge, but if you're going to build something sophisticated in the first place then this learning curve is no challenge to you at all. Another reason why this learning curve is worth the turn is because if you don't use a framework in the long run the code might get so unmanageable that you'll have no choice but to start from scratch, wasting valuable time and in most cases money. Another well-known argument is that frameworks are for beginners who want to use the RAD methodology of development. This, however, isn't true, because it's a well-known fact that all the big software development firms use frameworks when developing applications. There are many famous frameworks such as the .NET framework for the Win32 and Win64 platforms, and in terms of Web application frameworks there are numerous frameworks that are used by major Web sites such frameworks Coldbox, Fusebox, and Mach II. All in all, yes, there's quite a learning curve, but accepting the challenge will make your life much easier and keep your code managed and clean.

All developers know that time is always against them. A deadline is always looming over a developer's head and he or she is always in a rush to complete the application's lifecycle. It's not that the developer can't write code quickly, it's that once the code is written, debugging takes a much more time. By using an application framework, you'll have enough time to develop an entire operating system. An application framework is a predefined structure that will help you organize your application by using various object-oriented programming methodologies. Another reason why your development time will be reduced is that in almost every framework there's a set of predefined "solutions" that you can use to unravel a lot of the problems you might encounter during development. A good example of a framework that has predefined solutions is the Fusebox framework in which you simply tell the circuit.xml file when and what you want to load and it'll do the processing and code generation without any errors.

Another great motive for using an application framework is that you won't have to do repetitive tasks over and over again. For example, if you wanted every page on your site to check if the user is logged in, and you have well over a thousand pages of information the non-framework way of doing it will be to open each page and add a isDefined(Session.user) function to do the validation. However. what if you change the session variable to something other than user, you'll have to open thousands of pages again to change that variable. Using this approach will cost a lot of time and valuable resources. On the other hand, if you used a framework, you could have defined that on each page-request executing the function isDefined(Session.user) and later on if you were to change the session variable, you could easily change just one line of code in your application framework and it would do the job for you.

Better productivity is what every software developer wants and by using an application framework you'll get just that. In general, most application frameworks use object-oriented programming methodologies, which give you a lot of code reusability that in turn give you better productivity. For instance, if you were to create a class or cfc component (in this case) of all the items your authentication system does in your application then by using a framework like MACH II or even designing your own proprietary framework you can call the functions in those classes numerous times without having to write the code that many times.

The basic ColdFusion application framework that many like to call the Application.cfc framework is an example of how a framework can lead to better productivity. There are several solutions built into the framework that help you reuse your code. One useful method is the OnError, which is called whenever there's an error on your cfm page. In between this method you can declare some code such as <cfinclude template='error.cfm'/>, which tells the user to contact you in case of an error and every time an error occurs your code will be executed. This is a good example of code reusability because you don't have to go through all your pages and error check; instead by using that method the framework will do it for you. Also, some developers who are looking to use their time well can rest assured that all of these frameworks are simple to install, simple to use, and simple to deploy. To get any of these frameworks running, all you have to do is create a ColdFusion mapping to the core framework files and then use the framework skeleton application to develop on it. In sum, you'll have a much more productive environment and achieve a higher rate of code reusability.

Another reason to consider using a framework is that over time your code will grow, with all the patches and maintenance you make to it, and if you're using the spaghetti code method your code will look like it's been encrypted using AES. So rather than letting that unfortunate event occur, using a framework will help organize and maintain your code. An example would be using a framework such as Fusebox 5.1 and its MVC architecture to organize your code. Using an MVC architecture helps separate your code logic tier from your presentation tier and by doing this if you ever have to make modifications you can rest assured that it will have no visual impact on your presentation tier and vice versa. If you were to compare spaghetti code style to MVC-type architecture, you'll clearly see why life is easier on the MVC side. A framework will also increase code readability by organizing the code in a human-readable logical way, an example would be the Coldbox framework, which has a framework dashboard used to organize all your configurations of the application, so instead of digging deep into the code, you can easily configure your framework and application with a simple dashboard. Another great framework that you can use for a simple MVC-type architecture is MACH II in which you'll be able to develop applications faster than MACH II. What a fun framework. Generally speaking, a framework is a really good way to keeping all your code organized and will help you a lot when it comes to updating and adding new features in your code over the course of the application lifecycle.

All in all, using a framework can help increase code reliability by minimizing errors, increase productivity, and maintain your code through out the application lifecycle. As you can clearly see, these give you a significant advantage over the old spaghetti code method and learning how to use a framework can and will give you a good asset in your skill set. Many large corporations are looking for people skilled in many of the top application frameworks such as Fusebox and MACH II. Overall, after using a framework you'll wonder how you ever developed applications without it..

More Stories By Faisal Abid

Faisal Abid is a third-year student at West Hill CI and loves Flex, ColdFusion, and rich Internet applications. He is also the founder and owner of G-uniX Technologies (www.G-uniX.com), an RIA software development consultancy based in Toronto that specializes in Flex 2 and ColdFusion applications. He has a blog at blog.G-uniX.com that he updates bi-weekly with G-uniX news, Flex tutorials, ColdFusion tutorials, and Spry tutorials.

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

Most Recent Comments
Mujeeb Abdul 02/11/07 11:24:57 PM EST

Great article helps a lot to understand about framework


@ThingsExpo Stories
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Major trends and emerging technologies – from virtual reality and IoT, to Big Data and algorithms – are helping organizations innovate in the digital era. However, to create real business value, IT must think beyond the ‘what’ of digital transformation to the ‘how’ to harness emerging trends, innovation and disruption. Architecture is the key that underpins and ties all these efforts together. In the digital age, it’s important to invest in architecture, extend the enterprise footprint to the cl...
Data is the fuel that drives the machine learning algorithmic engines and ultimately provides the business value. In his session at Cloud Expo, Ed Featherston, a director and senior enterprise architect at Collaborative Consulting, discussed the key considerations around quality, volume, timeliness, and pedigree that must be dealt with in order to properly fuel that engine.
Two weeks ago (November 3-5), I attended the Cloud Expo Silicon Valley as a speaker, where I presented on the security and privacy due diligence requirements for cloud solutions. Cloud security is a topical issue for every CIO, CISO, and technology buyer. Decision-makers are always looking for insights on how to mitigate the security risks of implementing and using cloud solutions. Based on the presentation topics covered at the conference, as well as the general discussions heard between sessio...
IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
No hype cycles or predictions of zillions of things here. IoT is big. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, Associate Partner at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He discussed the evaluation of communication standards and IoT messaging protocols, data analytics considerations, edge-to-cloud tec...
Announcing Poland #DigitalTransformation Pavilion
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
CloudEXPO | DXWorldEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
DXWorldEXPO LLC announced today that All in Mobile, a mobile app development company from Poland, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. All In Mobile is a mobile app development company from Poland. Since 2014, they maintain passion for developing mobile applications for enterprises and startups worldwide.
The best way to leverage your CloudEXPO | DXWorldEXPO presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering CloudEXPO | DXWorldEXPO will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at CloudEXPO. Product announcements during our show provide your company with the most reach through our targeted audienc...
@DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22nd international CloudEXPO | first international DXWorldEXPO and will feature technical sessions from a rock star conference faculty and the leading industry players in the world.
Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution. In his session at @ThingsExpo, Akvelon expert and IoT industry leader Sergey Grebnov provided an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
In his keynote at 19th Cloud Expo, Sheng Liang, co-founder and CEO of Rancher Labs, discussed the technological advances and new business opportunities created by the rapid adoption of containers. With the success of Amazon Web Services (AWS) and various open source technologies used to build private clouds, cloud computing has become an essential component of IT strategy. However, users continue to face challenges in implementing clouds, as older technologies evolve and newer ones like Docker c...
JETRO showcased Japan Digital Transformation Pavilion at SYS-CON's 21st International Cloud Expo® at the Santa Clara Convention Center in Santa Clara, CA. The Japan External Trade Organization (JETRO) is a non-profit organization that provides business support services to companies expanding to Japan. With the support of JETRO's dedicated staff, clients can incorporate their business; receive visa, immigration, and HR support; find dedicated office space; identify local government subsidies; get...
Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
In past @ThingsExpo presentations, Joseph di Paolantonio has explored how various Internet of Things (IoT) and data management and analytics (DMA) solution spaces will come together as sensor analytics ecosystems. This year, in his session at @ThingsExpo, Joseph di Paolantonio from DataArchon, added the numerous Transportation areas, from autonomous vehicles to “Uber for containers.” While IoT data in any one area of Transportation will have a huge impact in that area, combining sensor analytic...