Your Privacy

This site uses cookies to enhance your browsing experience and deliver personalized content. By continuing to use this site, you consent to our use of cookies.
COOKIE POLICY

Your Application Needs a Rules Engine

Your Application Needs a Rules Engine
Back to insights

I can feel developers cringing just from reading the title. Until recently, I felt the same way; I thought rules engines were archaic, hard to implement, and unnecessary. The truth is that modern rules engines can be fairly lightweight and can add a lot of value to your application.

What is a Rules Engine?

Simply stated, a rules engine implements a collection of production, or business, rules. The implementation often appears to just be a set of if-then conditional statements. The value of the engine comes from the flexibility; rules can be written and grouped in any order, dynamically managed to turn certain rules on and off during execution, and re-executed automatically when the state changes.

A rules engine fundamentally doesn’t do anything that a long, elaborate string of if-else conditionals couldn’t implement, but it provides that same ability with modularity. When you abstract your rules out of your core application code, it makes the entire application easier to manage and test. A specification change no longer means a complete rebuild of your logic as rules don’t inherently interact with each other.

Example Application

Some types of applications lend very well to implementing a rules engine. Imagine an insurance application that processes a customer’s profile to produce a monthly rate. The calculation is derived from hundreds or thousands of variables with iterative computations and predictive forecasting. No matter the implementation, the application will be intensive and difficult to maintain.

If you can abstract the business logic away into segmented sections of rules, then the core application code becomes much simpler. Say a new business rule is added to increase rates because the customer drives a red car. The developer would just need to add a new rule to the correct rules group that matches the red car criteria and update the appropriate variables in the execution section of that rule. The application code then wouldn’t need to be retested, just that particular section of rules.

Rules Engine Variability

Choosing the correct engine for your particular scenario may be the most important decision in the implementation process. Rules engines range in complexity from simple conditionals to Rete algorithm implementations, which uses a complex path finding implementation of a node network. As expected, a simple engine will have an easy learning curve and little overhead, but the additional complexity of an advanced engine will have an edge in flexibility and computational speed.

If your application is strongly based on production rules or can be visualized as a state machine, then a rules engine implementation is something you should consider. However, if your production rules for the application are not well defined or won’t change over time, it probably won’t be worth the effort to learn and implement a rules engine library.

Digging In

  • Digital Products

    The Growing Importance of Digital Accessibility

    Embracing Digital Accessibility: A Moral and Business Imperative In today’s digital landscape, accessibility has become crucial for businesses and organizations. With increasing awareness and legal requirements, ensuring that digital products are accessible to all users, including those with disabilities, is not just a compliance issue but a moral imperative. At UDig, we champion ADA compliance […]

  • Digital Products

    Unlocking Business Potential: The Power of Custom Application Development

    Like any savvy business leader, you’re likely always on the lookout for tools to give your company a competitive edge. And in doing so, you’ve undoubtedly considered investing in custom application development. But the question is, how do you ensure that such a major investment in a custom web application development provides a strong return on […]

  • Digital Products

    Mastering Legacy Application Modernization: Strategies for Success

    The ironic truth of the business world is that change is the only constant. But this means that failing to keep pace with the competition and its technologies will only end with you falling behind. That’s where legacy application modernization enters the fold. When you modernize legacy applications, your team gains access to new features […]

  • Digital Products

    CTO Confessions Podcast

    In this episode of CTO Confessions, Rob Phillips, the Vice President of Software Engineering at UDig, digs into his journey from a passionate technologist in his youth to a seasoned leader in the tech industry. He shares valuable lessons on transitioning to senior leadership, the importance of understanding and articulating company problems, and the art of empowering teams for high performance.

  • Digital Products

    Navigating the Challenges of On Premise to Cloud Migration

    In today’s rapidly evolving technological landscape, the shift from on premise solutions to cloud-based infrastructure has become a pivotal transformation for organizations seeking to modernize their IT operations. This transition holds the promise of increased agility, cost savings, and enhanced scalability. However, it is not without its set of formidable challenges that organizations must navigate. […]

  • Digital Products

    The Power of Transferrable Skills in Tech Projects

    Every project has its own unique elements that require flexibility to be effective and achieve success. This often requires picking up new pieces of a tech stack, learning a new programming language, or a new project methodology. Fortunately, there are also many transferrable skills that carry over from one project to the next. In my […]