Featured Post

Want a Beowulf Cluster?

Rut sent me this link for those of you who want to obtain a cheap Beowulf linux cluster I found the perfect solution. Check out Pc Surplus. They are offering a “10 Pack” of P166 computers to use with as a linux cluster. It raises the question: If you spent a $1,000.00 on a new system today...

Read More

Building an English-Based Rules Engine in .NET with IronRuby Slides and Demo

Posted by Keith Elder | Posted in .Net, C#, CodeMash, IronRuby, Presentations, Speaking | Posted on 19-01-2012

3

As promised at CodeMash to those that attended my session I finally am getting around to getting the slides and demo from my talk posted to my web server. You can download everything at this URL location:

http://keithelder.net/Presentations/RulesEngineWithIronRuby/RulesEngineWithIronRuby.zip 

What you will need to run the demo:

  • Visual Studio 2010

To run the demo you should be able unzip it, open it up in Visual Studio and hit F5.

Once the demo opens you’ll be presented with this.

SNAGHTML29cde5e7

In the middle of the screen you’ll see sample rules for the survey already loaded.

To convert these rules to Ruby script click on the “SurveyRuleSet” option listed under “Rule Sets”. This will load all of the available rules for that rule set.

SNAGHTML29d09da1

Once you have the rules loaded for the SurveyRuleSet you can then click “Convert To Ruby Script” button and the English text in the middle of the page will be converted into Ruby Script.

SNAGHTML29d205e5

Once you have the Ruby script generated click the “Use Script in Survey”.

SNAGHTML29d4666b

This will open a form that has questions and answers.

SNAGHTML29d5267f

Once the form is open just press “Submit” and the rules will fire. You can close the form, change the rules, re-gen the script and then re-run the form to see new rule values run.

When the “Submit” button on the Survey form is called, this is when the IronRuby engine gets invoked.

You can also load the SouthernRuleSet and then load the pre-typed Southern rules to see a “Southern DSL” of the same rules.

In Visual Studio you can open the SurveyRuleSet.cs file and uncomment the other attributes to enable Spanish instead of English (just as an example).

DISCLAIMER

What you should try to take away from this the most are what it is doing and what is possible. We are running something very similar to this in production so this isn’t smoke and mirrors. There are a lot of things that are missing in the demo, but they are completely doable with some additional work. For example grouping isn’t done in this example, other rules like greater than, lesser than etc could all be added to the base ruleset class. Use your imagination and go wild.

Enjoy.

Speaking at Hub City NUG Thursday Jan 19th 2012

Posted by Keith Elder | Posted in .Net, Presentations, Speaking | Posted on 17-01-2012

1

Not everyone can make it to CodeMash so I’m doing what I can to bring CodeMash back to you. This coming Thursday January 19th, 2012, I will be giving the talk I gave at CodeMash at the Hub City .Net User Group located in Hattiesburg, MS. The talk will start at 7:00 PM with food being served starting at 6:30 PM.

Presentation: Building an English-based Rules Engine Using .NET and IronRuby

Abstract: In this session we will explore writing an English-based rules engine that allows developers to create domain-specific rules for an application that can be easily understood by anyone. We will use a combination of C# and the DLR (dynamic language runtime) with IronRuby on the .NET platform to create a way to write, manage, and process rules for an application.

Time: 7:00 PM (6:30 PM food starts)
Location: Deloitte Hattiesburg
Directions:
5912 U S HIGHWAY 49 SUITE H1
HATTIESBURG, MS 39401-7584
Map:
http://bit.ly/eDXYij

Deloitte’s entrance is an outside facing door to the right of Cloverleaf Mall’s food court.

English Based Rules Using .NET and IronRuby– Details on my Codemash Talk this coming Friday

Posted by Keith Elder | Posted in .Net, Presentations, Speaking | Posted on 09-01-2012

Tags: , ,

0

Geeks from all across the United States and across the pond with varying backgrounds will gather in Sandusky, OH during the heart of Winter once again, that’s right, it is CodeMash week. This year over 1,300+ attendees will be gathering for a new and improved experience that sold out in just a few hours. The Kalahari Resort has made some major upgrades (their ribbon cutting is even today!) to expand their conference center so CodeMash will be bigger than ever! And to top it off, they’ve asked me to be the MC again this year which is an honor within itself.

On Friday at 9:30 AM I’ll be speaking about how to represent business rules in plain English. I wanted to provide a few more details because honestly a one paragraph abstract doesn’t really explain what we’ll be covering and how excited I am about this talk. The cool factor and impact this could have on a business is pretty staggering. Here’s the abstract:

In this session we will explore writing an English-based rules engine that allows developers to create domain-specific rules for an application that can be easily understood by anyone. We will use a combination of C# and the DLR (dynamic language runtime) with IronRuby on the .NET platform to create a way to write, manage, and process rules for an application.

Ok, so what does that *really* mean? Well, it means a few things. For starters most all applications have rules of some sort. Some line of business applications have 1,000’s of rules. Imagine for a moment all of the rules needed to say… close a home loan, or process an insurance claim. In order to manage all of these rules businesses use what is called a “Rules Engine”. These rules engines are typically very expensive applications. They require lots of setup, training and offer many many features. With the majority of these one has to define a dictionary, vocabulary, and then write rules based on that. Managing these rules becomes very complex down the road.

What I am focusing on in this talk is taking something like plain old English (POE) that can be easily ready and understood and turn that into executable code. Here’s an example.

Let’s say we have this simple survey or set of questions or form data we are collecting.

image

Pretty simple form. But let’s say these are the rules your marketing department wanted you to implement (which you very well know are going to change at some point on a whim).

If answer to question 1 is Very Satisfied
And client is a repeat client
Then send them a discount coupon in the mail
If answer to question 1 is Very Unsatisfied
Then send survey via email to clientrelations@boyhowdy.com
If answer to question 3 is Yes
Then subscribe them to newsletter
If answer to question 4 is Yes
Then schedule a follow up call in 6 months

So you either A) hard code them or B) you use a rules engine. What we are going to do on Friday at CodeMash is take those plain English rules above and execute them using a combination of IronRuby and C# on the .NET platform dynamically.

Do I have your attention now? I hope so. See you on Friday.

Up and Coming Talks at Orlando Code Camp March 26th

Posted by Keith Elder | Posted in .Net, Speaking, WCF | Posted on 19-03-2011

0

Next weekend you will find me even further South than I normally am as I’ll be speaking at the Orlando Code Camp. A huge thank you goes out to one of the best places to work in the country and that is Quicken Loans (my employer) that not only allowed me to take a day off to get to Orlando but also helped out with the travel. Not only does Quicken Loans hold the current the highest nationwide ranking in mortgage origination satisfaction but the company understands community and wants to help give back where it can.

While in Orlando I’ll be doing two talks. One is a Back to the Basics talk that I was very happy that got chosen because honestly we do not have enough of these at code camps. This is the exact same session I’ve done at larger conferences such as TechEd and Codemash. Thus if you have any team members that don’t know .NET send them here!  Here is the abstract:

No other name in history has confused more people on the planet than when Microsoft named their development platform .NET. For a lot of developers .NET remains a mystery and it is often confused with many things. The Back to the Basics series is a primer for anyone that is starting at ground zero with .Net.  In this session we’ll look at what .Net really is, the benefits of the platform, bust a few myths and show some sound reasons why you should consider it as a platform. At the end of the session, hopefully we’ll answer one of life’s most puzzling questions: What is .NET?

The second talk I’ll be doing is on Windows Communication Foundation entitled “Demystifying Windows Communication Foundation 4.0”. There really is a lot of good stuff in WCF that simplifies a lot of things that really needs some light shed on it and I’m here to do just that. Why is WCF so important? Well put it this way, let me turn off services from the Internet and let’s just see how smart your Smartphone of choice is then. Services are the backbone of mobile apps and smart clients and it is important to know how to build them quickly and efficiently. Here is the abstract:

Windows Communication Foundation (WCF) has gone through two major releases and is now ready for prime time but may enterprise developers are still holding onto ASMX web services. In this session we are going to learn why moving to WCF is a good thing and much easier in .NET 4.0. We’ll also look at many new features in WCF 4.0 such as simplified configuration along with multiple site bindings introduced with the latest release of .NET 4.0.

I’ll have some Deep Fried Bytes stickers with me in Orlando so if you want one that’ll be the time to acquire one.

I’ve already packed my gator gun, mosquito spray, flippy floppies and bright colored shirts. See you in Orlando!

Deep Fried Bytes Episode #65: What does Open Source have to do with Windows Azure?

Posted by Keith Elder | Posted in .Net, Azure, Open Source, Podcast | Posted on 22-02-2011

Tags: , , ,

0

alt

http://tinyurl.com/deepfried65

In this episode Woody catches up with Robert Duffner of Microsoft to discuss the future of Windows Azure and how Open Source software fits into the vision for Azure.