Viewing By Entry / Main
February 6, 2010
A few folks have asked me to post the "napkin" on which I wrote the spec for FW/1. My "napkin" is actually Evernote because I have it on every computer and my iPhone so it's always with me and it's easy to develop notes with.

I started the spec on July 17th and "finished" it on July 20th. The spec was titled "New Lightweight Framework". Here's what it said:

Goal: Create an extremely lightweight convention over configuration framework.

Considerations:

  • Leverage Application.cfc and lifecycle
  • Automatically call controller, model, view if appropriate
  • Autowire from bean factory?
  • Application.cfc extends org.corfield.X
  • Programmatically set everything, no XML
  • variables.framework struct to specify everything
  • variables.framework.action is URL / form variable for the, er, action, defaults to 'action'
  • variables.framework.home is home action, defaults to main.default
  • fold URL / form into request.context
  • ?action=section.item maps to controllers/section.cfc:item() then models/section.cfc:item() then views/section/item.cfm
  • implicit layouts based on actions
Caveats:
  • Should controller / model be instantiated every request or cached?
  • How should cache be refreshed?
That's it.

I wrote the first version of FW/1 on July 19th. You can see the original 381 line framework.cfc on RIAForge.

If you click 'Return to SVN History', you'll see the entire history of framework.cfc - with the majority of changes since early November being Ryan Cogswell's awesome contributions. One of the reasons I love version control (and why I was so pleased to see Ray add source / history browsing to RIAForge!).

So there you go: an insight into my design process!

Comments

This is weird . . . clicking on "Return to SVN History" takes me right back to this post. This isn't supposed to be happening, is it?


Hats off to you for such a clear and effective spec. Does exactly the job its supposed.


Thats super cool, like a good pop song.

Just released my first production app (internal non public) using FW/1. Working like a charm.

Thanks Sean!


@Lola, I guess "Return to SVN History" just does a JS back then... Report it as a bug to Ray Camden :)


Hi, Sean,

Just taking a quick look through your spec and admiring FW/1 for its grace and simplicity.

One thing I noticed, though, it that the delimiter for a subsystem action is the colon and it seems to be hard-coded that way. We ran into an issue with colons when we used it as the delimiter for Mach-II modules. Certain network appliances (shall remain nameless) deem the colon to be the URL delimiter for port number (and only for the port number) and when they attempted to handle a Mach-II URL with a colon as a module delimiter all hell broke loose. We had a change it to another character to restore order.

Just a suggestion to make the delimiter a configurable parameter.


@Joel, good idea. Open an issue on the FW/1 RIAForge site for that!


Post Your Comments
Name:
Email Address:
Comments
*** Please note that all comments require moderation so it may be some time before your comment posts to this blog! ***
Remember My Information:
 



Hosting provided by