got net?

Kevin Hazzard's Brain Spigot

About the author

Welcome to Kevin Hazzard's blog.
E-mail me Send mail

Recent posts

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Mixing Static and Dynamic .NET Languages for Philly Code Camp 2008.3

I presented at the Philly Code Camp on 11 October 2008 for a group of about 20 developers. Thanks to all who came out to listen to my presentation. And thanks especially to Don Demsak (donxml) for attending and really helping me to shape the talk. Don added a lot of anecdotal information that I would not have included on my own. It was a very fluid discussion with lots of give and take. When I give this talk again at the Raleigh Code Camp in November 2008, the folks who attend will benefit from what happened in Philly.

The gist of this presentation is that it's possible to mix the Dynamic Language Runtime (DLR) into statically-typed, early-bound languages like C# to make them much more flexible. In this talk, I demonstrated how a ShoppingCart being filled with Products can adjust discount rates based on marketing rules written in an external Domain Specific Language (DSL). In this case, my DSL was really just Python. I chose to use Python because the syntax is so simple and clean. It's so light, it doesn't get in the way. It's not a real DSL, of course, but by injecting .NET objects into a ScriptScope on a ScriptRuntime (all DLR hosting terms), the Python syntax acting on those injected types looks an awful lot like a language for managing product discounts.

The few slides I had and the source code are linked below. For this code, I used IronPython 2.0 Beta 5. You will need to download and install IronPython to compile the code.

MixingStaticAndDynamicDotNETLanguages20081011.pptx (91.66 kb)

MixingStaticAndDynamicDotNetLanguages20081011.zip (16.65 kb)


Posted by kevin on Saturday, October 11, 2008 3:58 PM
Permalink | Comments (0) | Post RSSRSS comment feed

A Survey of Popular .NET Inversion of Control Containers

UPDATE: Gaja Kannan attended this presentation and gave me a great link to a post by Torkel Ödegaard concerning IoC container performance. Interestingly, of all the IoC containers out there, Torkel picked the same products as I did (plus StructureMap) for his tests. You can find the post at http://www.codinginstinct.com/2008/08/castle-windsor-dependency-lookup-and.html. Thanks, Gaja, for the link! 

On Thursday, October 2, 2008, I gave a presentation to the Richmond .NET User Group entitled "A Survey of Popular .NET Inversion of Control Containers". It covered Microsoft Unity, Ninject, Castle Windsor and Spring.NET. I talked about the history of the development of Inversion of Control (IoC) and Dependency Injection (DI). I demonstrated the concept in a sample application (linked below). I also discussed Aspect-Oriented Programming (AOP) and how it can be used to create highly cohesive, loosely coupled applications. The slide deck and code is available at the links below.

Source Code (77 kB)   Slides (268 kB)


Tags: , ,
Posted by kevin on Thursday, October 02, 2008 6:30 PM
Permalink | Comments (4) | Post RSSRSS comment feed