advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement

Tutorials : A Closer Look at the Java Rules Engine API (JSR 94) :

A Closer Look at the Java Rules Engine API (JSR 94)

by Benoy Jose

Introduction

The most frustrating part of a project is change and the sad reality is that change is inevitable. I cannot think of any project that was built the way it was originally designed without any changes made to the original. The problem of change becomes more evident in complex projects involving a lot of business logic, which keeps changing based on external circumstances. Sometimes the business rules have changed even before the project goes into production causing untold, mass rework to accommodate the changes. A good example is the insurance industry, new laws or market economics force changes, which cannot be foreseen and planned for during design. The solution for a dynamic environment like the above is to have a rules engine. Rule engines allow the business users to change rules without affecting the overall running of an application. The rules are defined separately from the application, and the logic to deal with the rules is built in during design. The rule engine takes care of applying the rules and the associated actions on the rules.

Now that we realize that there could be a need to have a rules engine to cater to changing business needs the problem is to choose one. Just like application servers and other softwares there are numerous rule engines in the market (Jrules, Ilog, JESS to name a few). Some of the factors that might have deterred companies from implementing a rules engine could be cost, lack of standards and compatibility with the existing frameworks. Most of these rule engines are proprietary and have their own proprietary APIs, which makes them less flexible to integrate with external applications. So a decision to abandon a particular product and pick another one would mean rewriting most if not all of the application code including application logic and API calls. Also, the cost of some of these rule engines could be cost-prohibitive. Another aspect worth noting is the lack of standards in the rule engine industry. JSR 94 is an attempt to standardize rule engine implementations for the Java language. The specification defines guidelines to provide a common API for use in rule engines. The JSR only provides guidelines for the rule administration APIs and rule runtime APIs. It does not define any guidelines for how the rules and actions need to be defined and what language will be used to define the rules. It does not provide technical guidelines on how the rule engine would read and evaluate rules. The specification leaves all the above questions to the discretion of the vendor implementing the rules engine.

Architecture

The architecture of the Rules Engine Specification is divided into two main sections, the Runtime client API and the rules administration API. Rules. The administrator API has classes to load rules and their associated actions as execution sets. It also maintains them. Rules can be loaded from external resources like URIs, Input streams, XML streams and readers. The administrator API provides for registering and de-registering execution sets and doing other maintenance functions on execution sets. The Administrative API is defined in the javax.rules.admin package of the Rules Engine API. Defining the rules using the admin package helps to control the access and running of rules by clients. The admin package can help to define the permissions on execution sets so that unauthorized users would be denied access to some controlled rules.

The Runtime API provides classes and methods to rule engine clients so that they can run the rules and get results. The rules registered using the rules admin API are the only rules accessible to the runtime clients. The Runtime API helps runtime users to acquire rule sessions and execute rules within the session. The methods and classes of the Runtime API are defined in the javax.rules package.

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.

 Microsoft Visual Studio 2010 Showcase
 Avaya Developer Showcase
 MSDN Spotlight
 PHP for Windows Showcase
XML error: undefined entity at line 39
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

Windows 7: From Beta to Final Code in One Year
Google Shows Off Chrome OS, Releases Source
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?
Fedora 12 Takes Aim at Linux Networking
Top Supercomputer Nearly Doubles in Speed
Fedora 12 Linux Tackles Virtualization
Apple Gives iPhone Developers App Status Tracker
Novell Sets OpenSUSE 11.2 Free

Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Exploring HTML 5's Audio/Video Multimedia Support
Overriding Virtual Functions? Use C++0x Attributes to Avoid Bugs.
Understanding the Cloud Computing Security Vulnerabilities
Cisco and IBM Target a Greener World
Upgrade to Visual Studio 2010 with the Ultimate Offer

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs