| By Faisal Abid | Article Rating: |
|
| February 11, 2007 10:45 PM EST | Reads: |
10,834 |
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..
Published February 11, 2007 Reads 10,834
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
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.
![]() |
Mujeeb Abdul 02/11/07 11:24:57 PM EST | |||
Great article helps a lot to understand about framework thanks |
||||
- Kindle 2 vs Nook
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- Confessions of a Ulitzer Addict
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- It's the Java vs. C++ Shootout Revisited!
- Cloud Computing Can Revitalize Your Career as Software Developer
- IBM Could "Reinvent" Java: Mills
- Oracle & Cloud Computing: Exclusive Q&A with SVP Richard Sarwal
- A Brief History of Cloud Computing
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- JavaServer Faces (JSF) vs Struts
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- What's New in Eclipse?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- i-Technology Predictions for 2007: Where's It All Headed?








































