Interesting blog post about three levels of business rules enforcement:
Credit: Thanks to a Twitter by By Louis Davidson:
" ...So I starting thinking that there needed to be some standard way to describe the different levels of business rule enforcement. For example:
Hard and fast – These are rules that will never be broken under any circumstances. Like an exact birthdate in the future. Or a negative amount of time worked (reversing entries could be an exception, but you would tag a row as such if needed.) Working more hours in a week than physically possible is another.
Abnormal range – This is a band of values that are not normal, but they are not necessarily wrong either. Overtime might be an example. For non-exempt employees, you might warn them “hey, OT is not usual, are you sure,” which, loosely translated to manager speak is “bozo, if you put in for OT pay and you didn’t actually work OT, I am going to pound you”. You might even use some form of predictive algorithm for this, like if this is the first time they have ever put in OT, a gentle warning might be raised when saving the time sheet.
Approval range – This is the level where the user is not empowered to make their own decisions. For example, take 168 hour week. I am pretty sure that this value (for the average user) would require some level of extra management approval. If not, a person could file a few of these doozies a few weeks before they quit and make a mint, assuming no other part of the process has implemented checks for abnormal ranges that is.
The question then becomes how to implement these rules. And this is where the battle begins to get ugly doesn’t it? Business rules in the database, the horrors! Well, ok, let me just say *my* feelings on the subject and feel free to chime in whenever... "
Read the rest of the story