Monday 13 May 2013

Rules Engine

It has been a while since my last post. I was caught up with several things for the past three weeks or so, I couldn't add any new posts at all. Well, things are back to normal and hopefully it will stay this way. 

Enough talking about me and let's head straight to the money talk. Well, during the past three weeks I have been preparing myself for a new project, a financial application. I did some deep study on what to use and how, etc ... One of the major points was the validation of my business entities. I wanted to simplify this procedure and locate the validation rules in one layer. By the way, I am a big fan of code centralization, having one thing handling all the validation stuff. I wasn't convinced with having my validation block segregated into two layers, a javascript one for the UI and the other one in VB.NET for the server side.

I decided to go with one layer, and the UI will invoke this layer to validate the objects (JSON objects). For me, I can accept the cost of AJAX posts for the sake of having one solid layer.

I started by implementing something myself, but then I thought there must be something ready out there. Some sort of a ready made library that can be used to achieve my goal. I started looking for one and I came across this wonderful and magical library called "Rules Engine". It is an open-source library hosted on CodePlex. I played with it a bit to get myself familiar, and to be honest from the first line of code I fell in love with it. It is a really nice, simple, straight forward, and comprehensive engine. I deeply recommend this for anyone looking for a good validation engine.

Happy coding ...

1 comment:

  1. Thanks for sharing, no need for lengthy if/else conditions to do the validations.

    ReplyDelete