My Secret Life as a Spaghetti Coder
home | about | contact | privacy statement
If you're not familiar with what cfrails is, it is a somewhat new framework (I started it in November 2006) for building applications in ColdFusion. It does things like saving records, getting records, populating forms, and data validation automatically for you. It also provides nice abstractions for those things which it can't automatically do based on the database metadata (for instance, you may want a month/year date field, rather than a full date). Since I don't want to take too much of your time describing it, more info on it can be found on this blog post about cfrails 0.2.0 or at the cfrails RIAForge project page.

This update is a super-minor version change, but a significant one.

First, a couple of minor items - I added some more aliases to have functions read better. For instance, instead of doing set_title_new() to change the default title on a view's new item form, you can now write newform.set_title(). Similar additions were made to the record listing table and edit forms. There will probably be other small aliases as well, as I discover more awkward function names. Some of those old ones will go away, but I'll keep the ones that aren't awkward. Just as well, I also made a few more aliases of the type camelCaseFunction = camel_case_function, to allow everyone to keep their respective programming styles. However, if you are naming arguments, you're currently at the mercy of whatever I have called them. I plan to standardize soon - its just weird thinking in Ruby and programming in CF - I'm mixing styles a lot.

I also noticed that I needed to mix views on occasion (for instance, a Person_view might need to display a list of checks written, which would be in another component). For this reason, I added getModel(modelName) and getView(viewName) to the mix. This is a great abstraction to remove the long and repetitive createObject calls. The downside is that apparently, CF6.1 and CF7.0 look components up differently, so these don't work (depending on your directory structure, I think) in the older version of CF.

The most significant addition, however, is that there is now some ability for relationships among tables to be added into your models without much effort: via a call to the autoload_relationship() method in your models. This was a bigger pain than I thought it would be, but well worth the effort.

Overall, I'm starting to get excited about the progress being made on this. I've been using it to extend an application we had written some time ago, and the results are good. For comparison, I took one of the "old" modules that was written without cfrails, of similar size to one I am working on now. The one written using cfrails is a bit smaller in scope and less complex, so I added in the other 2 "modules" I've been working on using it as well. Whereas the "old" one was over 500 lines, the 3 parts (two are quite small) using cfrails total to about 65, including white space. I spend more time marveling at the thing than I do programming (just kidding, of course =) ). Of course, this isn't any scientific comparison, especially since I'm sure I've grown as a programmer since writing the other one. But, it is still pretty remarkable. The hardest part is going to be memorizing the function calls. Well, not that it's hard, but it will take time looking at the (almost non-existent) docs, which may slow you down.

So, what's ahead? First I need to reconcile differences between CF7 and 6.1. After that, I need to add in abstractions to make "select" form inputs, as well as groups of radio buttons and checkboxes. There are some other abstractions I'm thinking of putting in, but I'm not sure if they add any value or just clutter the interface, so I'm leaving them out for now. Other than that, there are some more options I'd like to put in, like concatenating columns of a (HTML) table, to make the list more customizable. Finally, a few more major things are integration with an Ajax framework, integration with more DBMSs (right now, only SQL Server 2000 and 2005 are supported), and I'm toying with the idea of automatically loading referenced tables when there are columns of the type tablename_id. The biggest thing is re-writing the documentation. The only docs I have right now are based on version 0.1.0. Clearly, a lot has changed since then.

Those are the things off the top of my head. Even though the version number is only 0.2.1, I'm starting to feel awfully close to version 1. The main thing is that I want the interfaces (of the code variety) to be intuitive and easy to use, so I'm getting practice in using it. I may try to write a different application using it before I go to version 1, to make sure that it remains as easy to use in that one as it is in the application I'm using it for now.

Hey! Why don't you make your life easier and subscribe to the full post or short blurb RSS feed? I'm so confident you'll love my smelly pasta plate wisdom that I'm offering a no-strings-attached, lifetime money back guarantee!


Comments
Leave a comment

Oh yeah, if you've used it and would like to give me some input on what you found awkward or stupid (or even better - what could make it more lovable -- it /is/ Valentine's Day), please feel free to let me know.

Posted by Sam on Feb 14, 2007 at 01:57 PM UTC - 5 hrs

Oh yeah, I finally updated the zip, so if you visit the RIAForge page, you won't need to get it out of the repository.

Posted by Sam on Feb 14, 2007 at 02:04 PM UTC - 5 hrs

Leave a comment

Leave this field empty
Your Name
Email (not displayed, more info?)
Website

Comment:

Subcribe to this comment thread
Remember my details
Google
Web CodeOdor.com

Me
Picture of me

Topics
.NET (19)
AI/Machine Learning (14)
Answers To 100 Interview Questions (10)
Bioinformatics (2)
Business (1)
C and Cplusplus (6)
cfrails (22)
ColdFusion (78)
Customer Relations (15)
Databases (3)
DRY (18)
DSLs (11)
Future Tech (5)
Games (5)
Groovy/Grails (8)
Hardware (1)
IDEs (9)
Java (38)
JavaScript (4)
Linux (2)
Lisp (1)
Mac OS (4)
Management (15)
MediaServerX (1)
Miscellany (76)
OOAD (37)
Productivity (11)
Programming (168)
Programming Quotables (9)
Rails (31)
Ruby (67)
Save Your Job (58)
scriptaGulous (4)
Software Development Process (23)
TDD (41)
TDDing xorblog (6)
Tools (5)
Web Development (8)
Windows (1)
With (1)
YAGNI (10)

Resources
Agile Manifesto & Principles
Principles Of OOD
ColdFusion
CFUnit
Ruby
Ruby on Rails
JUnit



RSS 2.0: Full Post | Short Blurb
Subscribe by email:

Delivered by FeedBurner