Viewing by month: January 2007

Jan 30 2007

Frameworks Conference: At the hotel!

The Mariott here at the Frameworks Conference was kind enough to give me an early check-in, so I Metro'd up from Fairfax during my lunch hour, and I'm now happily working away in my room for the week.

If anyone else is getting in early and would like to grab a bite to eat tonight, etc., feel free to leave a comment and I'll get back in touch via e-mail.

4 comments - Posted by Joe Rinehart at 12:15 PM - Categories: Conferences and Speaking Engagements

Jan 26 2007

DeveloperPersonaFactory.createRandom()

Seriously, it'd be fun to take all of these meme's that have templated off of Tim's Post and assemble them into a random creator of developer persona's. Wish I had the time!

Anyhow, to be one of the gang, here it is:

  • 27 years old
  • Married for 1.5 years, no kids, one dog that's pretty much treated like a kid. Developer friends buy the dog christmas presents.
  • Drives a 2004 Jeep Liberty Renegade that now rarely goes offroad (in-laws sold their mountain house!)
  • Lives in a planned develop in the middle of cow pastures and tobacco fields
  • Owns a Macbook Pro for himself, bought an iMac for his wife, and convinced his mom to switch to an iMac from her Pentium 90.
  • Watches whatever his wife gets on Netflix, which means it's either zombie/slasher movies or romantic comedies
  • Loves Survivorman and House, but can't stop watching Supernatural
  • Rides a bike 100-200 miles a week
  • Tries to eat healthy, but has a thing for the bar/restaurant up the street with the great mozarella sticks
  • Is musically schizophrenic: likely to shuffle from Bad Religion to Wilco to Johnny Cash. Basically, if it's in 4/4 and has a guitar, it's ok.
  • Thinks YouTube often has better content, such as mountain bike trials, than television.
  • 1 comments - Posted by Joe Rinehart at 7:42 PM - Categories: Off Topic

Jan 25 2007

Model-Glue does not require XML, but it's a good idea to use it.

Recently, I've seen a few posts criticizing the use of XML for frameworks. One piece of misinformation they've contained is that Model-Glue requires you to use XML.

Read more...

8 comments - Posted by Joe Rinehart at 8:00 AM - Categories: Model-Glue | Causing Trouble

Jan 24 2007

How do Model-Glue scaffolds work?

Ah, documentation. Except for some time on my bike, I've spent all day doing presentation slides and Model-Glue 2.0 documentation. Not the most fun part of my life, but I'll be starting a new development project tomorrow, so I need to get it taken care of.

Anyhow, when documenting the generic database and scaffolding portions, I thought some people might like some extra insight into how "scaffolding" really works. It's very easy to picture it as one big monolith of code that has little do to with the partitions of MVC, but the internals follow a pretty good separation of concerns, leaving the API pretty easy to use from inside your own event handlers and even controllers.

Lowest Level: The ORM Adapter

The ORM adapter is sort of the "core" of scaffolding. It's a pretty straightforward interface that defines methods like new() (used to create a new instance of an object), save() (pretty self explanatory), list() (does a query), etc.

Inside of the ORM-framework specific implementation adapter, the intent (do a generic read of Widget where WidgetId = 2) is translated into framework-specific code (Reactor.createDAO("Widget").read(widgetId=2)).

Why's that good to know? Well, you can use the ORM adapter from inside any of your controllers by asking the framework for it:

<cfset orm = getModelGlue().getORMAdapter() />

That way, you can quickly invoke gateway methods to retrieve lists, do CRUD operations without writing ORM-framework specific code, and even get back the same metadata about properties and relationships that's used to generate the scaffold HTML.

Second Level: The ORMController

Scaffolds are really nothing but Model-Glue events that predefine some message broadcasts and results. These message broadcasts are known as the "Generic Database Messages" (GDMs) and include messages like ModelGlue.genericList (lists records from a table). The full list, and their behavior, is available in the Model-Glue documentation.

These messages are "listened for" just like any other message: there's a controller, called the ORMController, that's automatically loaded when the framework starts. It's just got the code-level equivalent of a few <message-listener> tags that set it up to "hear" these messages.

When it "hears" one of the GDM's, it gets the ORM adapter and calls the appropriate method on it, passing along whatever event values are appropriate.

It's not a really complicated setup.

Third Level: "Scaffolds" themselves

When your ModelGlue.xml file is read, it parses any tags inside of an <event-handlers> block, passing them off to something known as the EventHandlerFactory. A basic, vanilla event-handler tag results in the creation of an EventHandler CFC instance. A scaffold tag, however, results in the creation of multiple subclasses of EventHandler, representing the different types (such as list, commit, etc.) of scaffolds to be created. When the "scaffold" event-handler is created, it creates any necessary .CFM views via an XSL transformation, and adds appropriate message broadcasts, results, and views to itself.

After the framework loads all of the event-handlers, any that identify themselves are then "compiled" down to their basic Model-Glue XML and written out to /config/scaffolds/Scaffolds.xml - if you open it up, you'll see that they really are nothing but regular event-handlers with views ("V") that make use of the generic database messages, which are listened for by the ORMController ("C"), which then hand values off to the business tier of the ORMAdapter ("M").

And that's how Model-Glue does scaffolding while retaining the loose coupling of MVC!

1 comments - Posted by Joe Rinehart at 4:54 PM - Categories: Model-Glue

Jan 23 2007

Flex and Happiness

I'm like many of you: I didn't really, truly, "professionally" code for dollars (or pounds, yen, euro, etc.) until the browser was the runtime platform. It wasn't pretty, but it was expressive: through a simple markup language, we could rapidly deliver zero-install business applications in weeks that used to take teams of client-server developers months. The UI was clunky, but the business capability was there.

And, from then on, we entered a world of Javascript hacks. I've used the <layer%gt; tag (and what a catastrophe that was), divs with z-indexes, etc., all with the hopes of bringing the user a better experience.

In the end, all it brought was a world of user frustration and developer misery. However, we never stopped trying to find a "better way."

Right now, our options seem to be as follows:

  • Swallow the WPF Expression Blend Sparkle MS Kool-Aid

    (Vying for the price of most trademark violations in a single <li> tag)

    Frankly, I just don't get this choice. First, you have to figure out what each of the Microsoft products does. Then, you have to get the right versions of the IDEs and editors with the right versions of the compilers to run on the right versions of the runtimes that work with the right service packs of the right OS versions...oh, hell, nevermind, on to the next bullet point.

  • Ajax
  • Ok, Ajax is fun. I really do like it. It's swift, it's simple, it's great for modifying existing apps with some "rich" capabilities. It makes users happy, and there's nothing wrong with that.

    However, whenever I do Ajax work, I get this "develop in Netsc....Firefox, fix for IE" flavor in my mouth that reminds me of 1999. And, well, there's just no party in 1999 any more.

  • Flex
  • 1.0 was interesting. 1.5 was simply expensive. 2.0...oh, my. You read the docs. You install. You drag and drop, type, compile...and it just runs everywhere. I am a happy developer.

    I am not a designer.

    I am not an interaction architect.

    I am a developer. A developer who understands that a user must accomplish a task. A developer who wishes to turn a flowchart on a whiteboard into a UI a user enjoys interacting with through the browser.

    And with Flex, it just works. It's fun for me to develop. It's a joy for the user to use. And that's a no-brainer.

    3 comments - Posted by Joe Rinehart at 9:29 PM - Categories: Flex

Jan 22 2007

The Flex Show: Keepin' me warm!

Yesterday was a bad day out on my bicycle: I was going to do a 25 mile easy spin (with a few hills) after Saturday's debacle of doing bonus miles looking for a lost rider.

It's a bit cold here in North Carolina right now, and I wound up pushing my bike through freezing rain.

I tend to listen to podcasts when I'm riding because they're not loud enough to block our road noise, and they sound fine in mono (I only like to have one earbud in on my bike).

What does this have to do with The Flex Show podcast? First, it's a great resource for Flex developers, especially those from a ColdFusion background: Ryan Stewart and Jeff Houser are both Flex developers who do ColdFusion work as well, so it's bound to be relevant. Second, right when the sleet got particularly nasty while slogging up a long hill, they mentioned Firemoss as a a good resource for ColdFusion developers doing Flex, and welcomed me to the world of unemploym...errr.."independent consulting." Thanks guys!

2 comments - Posted by Joe Rinehart at 9:29 AM - Categories: Flex and ColdFusion

Jan 19 2007

Hey, CFers! Ready to code?

Are you ready to code? The wait is almost over!

3 comments - Posted by Joe Rinehart at 9:12 AM - Categories: ColdFusion MX