Using Spring.Net for dynamically creating objects

*I am not an expert on spring or IoC - I would like to have my client app "select" different implementations of an interface based on some conditions.

I believe Spring (or other IoC containers) allow doing this, however all examples show that the concrete class is configured in some configuration file, which is not what i am after.

I would like to (somehow) allow the container to decide which implementation to choose from (based on some conditions and a given set of classes to select from).

Is this possible? ( i am pretty sure it is).


你可以使用一个工厂类(它可以是静态的或实例工厂)。

链接地址: http://www.djcxy.com/p/77770.html

上一篇: 重构工厂没有违反开放原则

下一篇: 使用Spring.Net动态创建对象