Thursday, December 21, 2006

When was the last time you did something for the first time?

This week, would be my answer. I created object of a class from an object in C#.
// You can get class name and dll path from some config file.
// Using a properties file with name value pair is a good idea, I'm told.

String className = "Domain.Project.Class";
String pathOfDLLFile = @"c:\whatever.dll";
Assembly loadedAssembly = Assembly.LoadFrom(pathOfDLLFile);
IClass loadObj = (IClass) loadedAssembly.CreateInstance(className);
Coding is pleasure when you are successfully doing something really small.

In my professional life, this is third platform I'm working on. I started with C on Solaris-Linux, then moved to Java on Linux and right now with C# on Windows. When you are doing something interesting, the passion for programming language, OS and editor diminishes.

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]