What are business rules? Where we use them ?
Business Rule is a some kind of a rule that relates to a particular business. From time to time this rules may change. We know there is a logic behind each and every decision we get. Normaly we are getting some decision by considering some facts. Same thing apply to business. In business we get some decision , after considering some kind of facts. These facts may change from time to time according to the nature of the business.
Lets take a simple example : A Mobile Service Provider
With the experience we know , Mobile Service Providers most interested party is their customers. So they do many kind of promotions to attract customers to them. So from time to time they change their call rates and freely available features , etc. Here What they are doing is changing the logic from time to time according to their requirement. But they do not change the way they operate.
Basically we can separate this in to two parts;
1. What is to be done (Logic)
2. How is to be done (Implementation)
So in our example, from time to time , Business development team of the Mobile Service provide change the logic. We know Mobile Service Providers are running there business with some kind of a software. So software is developed by developers when the logic is clearly identified. Lets take a simple example:
if the season is new year festival season , all the call rates must be reduced by 10%
So this is the logic that software should perform actions behind. This logic may change from time to time. So if we are going to implement software using if else statements, We have to implement it each and every time logic changes. In Software world, This is a mess. So we need to have a solution to this problem, which we can change the logic with out changing the software.
This is the point Business Rules comes in to play.
With the use of business rules we can change the logic, with out affecting to the implemented software. There are many kind of rule engines. JBOSS Drools is the most common language we can use to write these business rules.
Since business rules are decide by business management people, business rules should be easy to understand by a person who have very little knowledge in java, c++ or what ever. Drools provide this simplicity.
you can get clear idea on drools by refering to the JBOSS Drools web site