Welcome

You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

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.

How To Build Windows Services in .NET The Easy Way with Topshelf–Part 1

Posted by Keith Elder | Posted in .Net, Windows, Windows Service | Posted on 12-02-2011

8

Building a Windows Service is something most .NET developers will have to do at one point or another.  While not too terribly difficult to understand and build there is a little bit of a learning curve to build one.  That’s not the hard part though.  The hard part is debugging a Windows Service.  It can be very painful.  There is an easier way that I’ve recently discovered that more developers need to know is available.  I’m talking about Topshelf.

Topshelf is a cross-platform (Windows and Mono) open source project that allows developers to build Windows Services as Console applications (which are WAY easier to debug) and then run their program as a Console application or as a Windows Service.  As if that wasn’t enough Topshelf also allows one to xcopy deploy Windows Services.  I know, crazy huh! Here is a brief walkthrough on how it works.

Step 1

Download and unzip the Topshelf files.

The current version can be downloaded from the following location:

 http://github.com/downloads/Topshelf/Topshelf/Topshelf.v2.0.0.0.zip

or

NuGet can be used to install Topshelf if you have NuGet installed.

PM> Install-Package TopShelf

http://nuget.org/Packages/Packages/Details/TopShelf-2-1-0-85

For this walkthrough I’ll assume you don’t have NuGet installed.

Step 2

Create a Console Application in Visual Studio

Step 3

Right click in Visual Studio on “References” and “Add reference” to the Topshelf.dll you just unzipped.

Step 4

Now the fun part.  Add a class to your project.  In that class add two methods called Stop() and Start().  These methods will be called when your console application is started and stopped or when the Windows Service is started and stopped.

   1: public class WordsofWisdomService

   2: {

   3:     public void Start()

   4:     {

   5:         Console.WriteLine("Starting Words of Wisdom...");

   6:     }

   7:  

   8:     public void Stop()

   9:     {

  10:         Console.WriteLine("Shutting down Words of Wisdom...");

  11:     }

  12: }

To show the proof of concept all I’m doing is printing to the console when these methods are called.

Step 5

Open the Program.cs file in the project and in the main function copy paste the code below.  This will wire up the above class to Topshelf. 

This tells Topshelf all it needs to know about what will become our Windows Service including description, name and so on.  Here’s a sample, reading it should be pretty self-explanatory.

   1: static void Main(string[] args)

   2:         {

   3:             RunConfiguration cfg = RunnerConfigurator.New(x =>

   4:                 {

   5:                     x.ConfigureService<WordsofWisdomService>(s =>

   6:                         {

   7:                             s.Named("WordsOfWisdom");

   8:                             s.HowToBuildService(name => new WordsofWisdomService());

   9:                             s.WhenStarted(ls => ls.Start());

  10:                             s.WhenStopped(ls => ls.Stop());

  11:                         }

  12:                         );

  13:                     x.RunAsLocalSystem();

  14:                     x.SetDescription("This service returns words of wisdom when asked.");

  15:                     x.SetDisplayName("WordsOfWisdom");

  16:                     x.SetServiceName("WordsOfWisdom");

  17:                 });

  18:             Runner.Host(cfg, args);

  19:         }

Step 6 – Debug, Run and Install

At this point we are practically done building a Windows Service as well as an application that will run as a Console application.  To show you how simple this is I set a breakpoint in the Start() method of the class.  Pressing F5 to launch the Visual Studio debugger we can see we hit the break point.  This is gold as we didn’t have to do anything we wouldn’t normally do to debug in a Console application.

image

This is the awesome part about Topshelf because we can easily test our service without having to jump through a bunch of hoops.  But here is the best part.  Let’s run it directly from the command prompt and see what happens.

image

That’s it, our application is running and ready to do whatever it programmed to do.  The best part of this is we can now make it a Windows Service by passing a command line argument of “install” to the executable.  When doing this, it will be installed as a Windows Service.  Notice that I am running this command prompt as an Administrator. 

image

Not only did it install our service but it created an EventLog source for the application as well.

If you have to administrate Windows Services for developers you should be really happy right about now.

Let’s open up the services.msc console and find our service.

image

We have a service!

We can easily reverse the install by passing “uninstall” to the executable and the service will be removed from the system. 

But wait there is more that Topshelf can do, stay tuned, we’ll look at that in Part 2.