Monday, August 8, 2005

Set the rules with JSR 94

It's almost too easy to express your business logic as a spaghetti-code fiasco. The result is hard to test, hard to maintain, and hard to update. Rule engines offer an alternative: express your business logic as rules, outside of your Java code, in a format even the business side of the office can understand. Paul Browne uses the open source Drools framework to introduce the idea.

rating comment: Nice article which gives a good introduction to rule engines, their use and notion. I've checked out the drools implementation of JSR 94 and made a small example which I'll upload sometime this week.

I'm not too happy about drools, cause I think the complexity, at least using drools, is only being pulled out of the code and put into an XML file. And now you have your code in two different files, which doesn't simplify things, it makes them worse! Okay you can use Java, Groovy or Phyton to define your rules in the XML file, but that won't reduce the complexity of implementing business logic. With drools, you cannot delegate the definition of rules to business experts, since they need to have programming experience.

There is one advantage though: You can change your business logic at runtime! Unfortunately that's the only one I see.

No comments: