15 March 2011

I hate business rules!

Actually, I don’t really hate business rules, they’re one of the bits that makes programming creative, useful and challenging. But I do hate it how they’re spread all over the place.

I’ve been working with a consultant to rev our codebase for our CRM installation lately and today was deployment day. As usual, we thought we had everything together. Now, I’ve been finding myself asking, “What’s causing this to run?” or it’s usual variation, “Why is this happening?” Often, these are attached to the comment “That’s odd.”

I suppose the cause here is that business rules are spread all over the place. Some of them are configured through the UI, some (many) are in code, some are in stored procedures, some are in config files lying around the place. There’s no single way of finding out what causes something to execute. Even in our code, business rules are spread all through the code (mixed in with the infrastructure code, guard clauses, error handling code, etc.)

There’s got to be a better way…

2 comments:

  1. A dedicated business rules engine?



    And some good logging.

    ReplyDelete
  2. Hey Scott
    If not a dedicated business rules engine, at least a common place where they can be accessed from. Somewhere that can be read and modified without the need for re-compilation.

    ReplyDelete