Quantcast
Viewing all articles
Browse latest Browse all 2

JBoss Drools – an Initial Study


As we have faced ever-changing business rules environment of organisations, we were in search of some sort of code base, by which we can atleast resist the every week deployment scenario of Application in Organisations.

So, here we have found JBoss Drools – an rule engine offered by Jboss.

Well structured Java web/enterprise applications are mainly separated into

1> Front-end layer,

2>Service and business logic layer

3> Data Access layer

 

By using RAD tools, we can build dao code automatically, with proper database designed.

One of such framework is Spring Roo.

Also for structured web framework, there is struts, spring mvc or Google Web Toolkit and such other good farmeworks.

To fight with every-day changing business logic, a standard framework was much needed, which can be handled without deploying the actual code base.

So here JBoss Drools comes with rule engine.

Definition of Rule Engine -

A rule engine is a way to handle any situation with “what to do” approach to solve a diverse set of problems with Data with the defined rules as set in the framework, which actually drive the automation of business rules.

What we can do with Rule Engine -

  • Separate the DAO objects from Business Rules to minimise the deployment issues and put the rules in the system dynamically to validate the data set to be stored in the application.
  • Use of knowledge from Business Rule Implementation experts and let them handle the rule without touching the actual enterprise system architecture.
  • Use of rules as much as readable by general users i.e. not only core technology guy can use it – all the main stakeholders of the application can use and extend it and use this as further evidence of present business logic.

Usually Jboss drools files are written in .drl files.

These files consists of set of rules.

The dataset, which is passed through the service and business logic layer, are validated against the set of rules in the .drl files.

An example rule we might consider is -

“We will buy the car if we get a $30000 loan”

So the rule will be in JBoss Drool Language -

rule “BuyCar”
when
carLoan:CarLoan (amount<30000)
then
System.out.println(“Can’t afford the Car”);
end

So this is a very basic introduction or JBoss Drools.

I will cover -

Advance concepts about Drools rule engine.

Case Study of Drools Framework in practical application.

So, This is my first post regarding JBoss Drools.

Comments regarding Drools are welcome.

 

 


Viewing all articles
Browse latest Browse all 2

Trending Articles