Configuration with IronPython

Mark Bloodworth is an architect evangelist who has blogged several times about IronPython. He has put up two more blog entries on using IronPython as a configuration engine.
Configuring applications in code seems like a good idea.  Configuring them in code written in a dynamic language seems even better.  Let’s look at a simple example with IronPython.

...

What next?
I’ve kept this example as simple as possible to show the principles.  The advantages of using Python code (it would be simple to use IronRuby, too) are that it’s simpler to write, testable, more powerful and doesn’t need pre-compiling.  And it could do much more than set a couple of properties.  In C# 4.0 the dynamic keyword would allow the Configuration class (and classes like it) to be dynamic, so that the properties and methods could be referenced at runtime without having to be declared ahead of time.
Recently I posted a short article about how to do simple configuration with IronPython.  I figured that it would be easier with .NET 4.0 thanks to the dynamic support.  And it is.  Using Visual Studio 2010, create a new Console Application.
...
The result is (I think) more simple and elegant than the configuration code to which I’ve become accustomed.

Comments

Popular posts from this blog

Extending Abobe Flash Player and AIR with Python and Ruby

Should Python Projects Support IronPython and Jython?

Further Adventures of the Debugger