views:

138

answers:

4

We have a medium sized ColdFusion code base for our Intranet and Website. For most of the history of the code we have used hard coded links in the cfm's for where to go and for what 'save' code to tun.

In the last few years we've began using cfc's to handle more of the "navigational" code as well as more automated save code (implicitly calling the save process for a given cfc on init)

Assuming that it makes sense to begin using a framework, is it better to begin using it for newer projects or attempt a full scale conversion?

EDIT

To avoid confusion, I'm sensing that by moving to more cfc based code we are going down the path of accidentally creating our own framework. It seems to me that taking a proactive step toward using a proper framework and allowing the cfc's to process data is probably a wiser choice.

+5  A: 

I'd only put the effort into a conversion if you were spending more than 10-20% of your time maintaining the project. (Your threshold my be lower or higher.) Other than that, use it just for new projects.

Why? I think the conversion is going to be painful, laborious and potentially a waste of valuable time.

Stu Thompson
A: 

Have you considered using a framework such as fusebox instead of rolling your own? If you begin using a framework on new projects you might then find it easier to apply what you've learnt to existing projects.

teabot
Thanks. That's basically where we are at. Hopefully the edit above makes it more clear.
Tom Hubbard
+3  A: 

"Assuming that it makes sense to begin using a framework, is it better to begin using it for newer projects or attempt a full scale conversion?"

I would say that the biggest criteria for whether you should move to a framework are:

  1. Am I spending a good amount of time maintaining current code, and is it difficult?
  2. Am I repeating a lot of code? Do you find yourself writing a lot of the same thing over and over when adding to the current project?

Depending on how large the application is, it might be worth it to convert a current application to a framework if it saves you more time down the road by making maintenance easier and reducing code repetition for future additions to the current project. If you rarely maintenance the application except for a few tweaks here and there, then I would say leave it alone and use a framework only for new applications.

Jayson
+1  A: 

Frameworks have a short term cost and a long term gain.

When we start out without one we usually start building one over time indirectly to increase re-use of code, and make things more structured..

I have been a big fan of Fusebox, probably because I've just used it for so long.

What I have done in the past is, if I know the site will never be updated in into any real website functions, I just roll my own cfswitch to navigate between actions. each action I simply break down into the dsp act qry type files fusebox likes.

If ever I need to put it into fusebox, most of my circuits and actions are already done. The path forward is a bit easier.

On the other hand, if I know the client may want more in the future, I will just put it in a framework and leave it at that.

On a sidenote, I have also been checking out the very impressive ColdBox -- which seems to have some fantastic support, scalability and very well documented is cfc intensive... check them out too..

Jas Panesar