这里是c#的例子.运行时类型绑定.
ArrayList images = new ArrayList ();
//这里的names可以从配置文件中获取
foreach (string name in names)
{
Assembly a = Assembly.Load (name);
Type type = a.GetType ("PlugIn");
MethodInfo method = type.GetMethod ("GetImage");
Object obj = Activator.CreateInstance (type);
Image image = (Image) method.Invoke (obj, null);
images.Add (image);}
At the end, the ArrayList named images holds an array of Image objects representing the images obtained from the plug-ins.