Rules: Home | Background | Example | To-Do | Goals | Plan

Rails on Rules: Background

June 4, 2007

From March 2001 through January 2002, I worked as a WebObjects developer for NetStruxr on their SPACEdirect system. In those 10 months I saw a very small but talented team improve a complicated system faster and more reliably than I had seen before, or since.

The key to our success from a technology standpoint was Direct To Web, WebObjects' declarative development framework. It employs a rule engine and comes with a rule creation application that makes it easy to enhance your application simply by declaring rules and using those rules in your templates and controllers.

Lately we've been seeing some great advances in web development frameworks. Some of Ruby on Rails' core philosophies point in the direction of a more declarative environment.

DRY - don't repeat yourself.

If you only have to specify a rule once to affect behaviour application-wide, you're DRY.

Convention over Configuration.

It's not that configuration is bad, it's that having to maintain the configuration of every bit of minutia of every library you use becomes a serious problem. But if your configuration specifies new conventions, you're winning, not losing.

Many of Rails and ActiveRecords' "conventions" can easily be expressed as rules, and similar rules were bundled with the DirectToWeb framework. For example, the label of a property called "firstName" would be "First Name". In Rails, the convention is to name the property "first_name" rather than "firstName", but the result is the same - if you follow the convention, you can avoid having to configure the label of the property, because Rails can do it for you.

Using a rule engine makes it even easier to create and follow new conventions that increase productivity.

Immediate feedback

When you make a change in your code you should be able to reload the page and see the change immediately. Changing your application by modifying your rules rather than code should make it even easier to support rapid turnaround. This is something that Direct To Web actually didn't do as well as it should have, but the improvements to Direct To Web in the open source Project Wonder framework for WebObjects made rapid turnaround a reality.

I think Rails is currently winning the developer mindshare war and is leading the charge for change in development practices. Therefore, I want to create a rule engine similar to the one from Direct To Web to promote adoption of rule-based development on that platform and others.