Code review

Hi all,

I’ve just spent some time writing a very simple coldfusion framework for use with some in house projects at work, and I wanted to post it here and see if anyone would mind taking a look and giving me their opinions on it. Just keep in mind that it’s not intended to be a comprehensive web framework, just a few cherry picked components and conventions that I’ve found useful and that integrated well with our existing legacy code.

I’m relatively new to coldfusion, so I would be very grateful for any help you guys can give me reviewing parts of this.

I look forward to your comments!

I think its excellent. I like how you took a modular approach and the way routes were handled is awesome. The only thing I would recommended is maybe making it somehow so you can decide if cfoutput tags manually or automatically implemented on template pages.

Hiya,

I’ve only breezed through the code but what about it makes it ColdFusion 9 only?

I’m running ColdFusion 8 so I don’t know if it’s worth me downloading if it is. Or is it just the case its only been tested on CF9? Worth looking at as there is still a fair share of Developers out there who are not on CF9.

One suggestion for you - look at the idea of allowing people to setup application-specific mapping rather than relying on them doign it through the CFAdmin ones.

Some Developers won’t have access to the Admin, i.e. shared hosting, so that’s going to put people off looking at this. I know for example the FarCry team have hit issues with this in the past.

The other thing is I might want to run multiple versions of the framework. An old project might be using an older version while my shiny new project is using the latest stable release. Using Admin mappings won’t allow me to do that.


Along the same lines, shared hosting generally puts you on the web root. To have your root access a level in (I think you called it “publishing”) can give people a headache. If you look at things like ColdBox it tends to have the Application.cfc and index.cfm in the webroot and everything else sits next to it.

Anyway, hope that’s some useful feedback :cool:

Cheers,
James

Thank you both! I really appreciate you taking the time to help me out.

@Darren884 That’s a good point about templates, I’m not entirely happy with how they get rendered myself at the moment (it’s a bit of a hack!) I think I just felt like I shouldn’t be using a seperate template language when that is something that coldfusion is essentially built for. I’ve got it on my todo list to look at how some other frameworks coldfusion frameworks manage this and see if I can find a more robust method for handling it (hopefully with some external library.)

@Clarkee21 The coldfusion 9 thing is mostly just a disclaimer of no testing you’re right, I came straight into 9 when I started coldfusion, so while parts probably will work with 8, I’m certain there will be things in there that aren’t backwards compatible.

And those are really good points about application specific mappings, I hadn’t really thought about that side of things before, it’s now on my list to investigate!

Also the published folder convention is a kick back from a legacy cms I’ve had to write this thing to work in conjunction with, it bakes all the pages into that directory, so rather than use the front-controller type pattern that most things use (and that I’m used to) I’ve ended up with a kind of fragment-controller pattern. Which is why I wouldn’t really recommend anyone actually use this framework for anything other than lifting potentially useful bits of code from for their own projects, something I should clarify in my project readme.