简体   繁体   中英

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).

您可以使用工厂类 (可以是静态或实例工厂)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM