Posted in ColdFusion | Posted on 12-11-2009 | 3,044 views
A colleague on Facebook sent me a quick question asking me about frameworks:
Why use a framework?
What are the positives about having a framework?
If you made a very simple framework without trying to code it what would you LIKE it to do?
Is there anything you think it should NOT do?
So one by one....
Why use a framework?
I use a framework because it solves a problem. I try to apply that to anything cool I see in regards to frameworks, design patterns, etc. If it doesn't solve a problem I have, then it isn't something I need at the moment. As to what problem it solves for me - it helps me deal with how I organize my files and structure the 'flow' of my application. That may seem minor, but it really relieves me of a lot of 'grunt thinking' - ie, thinking about simple crap. It lets me focus on more difficult stuff.
What are the positives about having a framework?
Well along with what I described above, it also gives my application a standard that makes it easier for other folks to work with. So given that an application uses framework X, I can hop on the web site, check the docs, and I'll be able to more easily understand it.
If you made a very simple framework without trying to code it what would you LIKE it to do?
Well, I'd look at what I like in Model-Glue and FW/1 - mainly the mechanics of handling the flow of my application. I hate to sound like I'm repeating myself, but what I described above as what I liked is obviously what I'd build into a new framework. (But let me just add - before creating a new framework, you probably want to look into working with an existing one!)
Is there anything you think it should NOT do?
As I said above, a good framework handles the flow and layout of an application. I get to focus on business logic and UI. To me - that's all a framework should do. Anything else is cow bell and not strictly necessary. I'm happy, for example, that Model-Glue doesn't do what ColdSpring does. Let each take care of their own domain.
What do you not use a framework?
There isn't a hard and fast rule for this. For "smaller" sites I probably wouldn't bother, but I've rarely seen sites shrink. Most sites grow. I didn't use a framework for ColdFusion Bloggers and I wish I had. Also, it depends on your framework. Something like FW/1 which runs completely by convention has an extremely small amount of overhead. In cases where I feel an application is too small for Model-Glue I might still consider FW/1.
In general, I tend to work with sites. I don't build tiny one page applications. So I almost always use a framework.


everybody knows you need more cow bell baby!! you gotta have more cow bell. don't be hatin' on the cow bell.
I look at the Model-Glue install instructions and step one is install ColdSpring.
Do i need to learn ColdSpring before learning Model-Glue?
FYI, I gave a MG presentation to some coworkers about two weeks ago. I'd be willing to give it to the CF Meetup. I just want to wait till past X-Mas.
And let me be clear - when it comes to learning MG, CS, or anything: I think it's always a good idea to learn new things. But just because you learn to do something doesn't mean you should ALWAYS use it. The biggest thing to keep in mind is that frameworks, design patterns, etc, have a time and place when they should be used.
I built a few small flex apps last year and have not touched Flex since. I have a hard time supporting the apps now and wish i just did them in CF. BUT each time i do touch them i remember more of how it works so the learning continues just slow and painfully.
I understand the concept of MVC and i have my own way of doing it. I will give Model-Glue a shot if it can help me organize my code better and help me work in larger groups of programmers.
I just don't want to try to make my CF programming OOP.
Give me reduced duplicate code and centralized functions that are easy to maintain and i can call from any page and that is enough organization for me.
Thanks Ray!
I think that is a sign of a framework poorly designed. A framework should be easy/rapid to implement and use from a developers stand point no matter the size of the site.
Another stumper:
Should a CF frameworks be treated like a design pattern where one solution doesn't fit all problems?
In RoR, it is seems Rails works for all size project but I am not positive. I have heard scalability issues but CF has had its bouts with those rumors also.
Interesting stuff to ponder.
In terms of CF frameworks, I am firmly of the belief that there is no one solution fits all framework here. Many times, I don't even think a framework is required.
You can write MVC code and OO code without using a framework, and you can write good code without using a framework too.
I use OO approaches in my applications as much as I can but I have not fully moved to a framework. I have tried Farcry and find the documentation quite hard to get through efficiently. I have heard of Mach-II, ColdSpring, MVC, Model-Glue but never had the time to really sink my teeth into the topic.
I feel I want/need to learn a framework for use with certain ColdFusion applications but I want to learn it well. I have some time off between jobs so what would people recommend as a framework I can learn quickly and soundly and have solid resources for reference and to look back on later (it frustrates me when documentation lacks for applications)?
Also, is it easy to integrate CF9's new Hibernate ORM features with a framework?
I understand these questions may be a little broad and maybe a little obvious to some, I'm just a little lost on this topic as I don't want to dive in the deepend of frameworks when I could have started out easily with a solid base for research into other frameworks later.
Thanks!
PS I was in the same boat, trying other frameworks and cfwheels felt most natural and clicked.
@Mike: There is never - ever - one true way to do everything. I will say though - from an organizational view - I find a MVC framework like Model-Glue to be almost universally useful since any application of a decent size can be helped on the organizational side.
Does that make sense? I don't think it does. Kumar kinda is saying when I'm trying to say here too.
@Steve: ORM is a tool. You can use ORM with old procedural apps, MVC apps, or voodoo apps. Doesn't really matter. I'm using ORM with a new CF9 app that makes use of Model-Glue and ColdSpring. It is AMAZING how productive you can be with ORM.
* Adobe ColdFusion 8, Adobe ColdFusion 9, Railo 3.1
* SQL Server 7 or later, Oracle 10g or later, PostgreSQL, and MySQL 5.
I think there is development on a plugin to switch out the default ORM and use hibernate. If not that would be a cool plugin someone could build.
[Add Comment] [Subscribe to Comments]