Saturday, February 3, 2007

Absolutely Excellent: Declarative Rails Workflow

The blog post and the screencast.

Pat Maddox's workflow engine. Really, really good idea. Basically it allows you to develop as if Active Resource were the same thing as Object -- which it essentially is -- and avoid writing Rails as if it were PHP. I don't want to say too much about it until I've actually built something with it, so just take a look at the screencast. Both the screencast and the post demonstrate why there's a need for something like this in the first place before going on to show how much easier this approach is.

As somebody who thinks that Rails and Seaside both have compelling advantages over each other, yet totally wtfpwn other frameworks, it's really nice to see this, because it really brings some of the advantages of Seaside into Rails. Pat's workflow engine decouples the requirements of creating or updating "a resource" (an object) from the create or update actions doing the creation or the updating. The reason this is useful is it allows you to juggle these things flexibly, the same way you can in Seaside. Your code has no restrictions on the order that attributes on a (resource|object) are defined, so you can pretty much locate that stuff anywhere in the application you want. Obviously, if you integrate it nicely with Ajax, you've got the capacity to save data as flexibly as a desktop app can.

Again, I haven't actually used it yet, please take this with a grain of salt! However it looks like a very, very good idea.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.