For a list of all members of this type, see ObjectFactoryCreatingFactoryObject Members .
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
The primary motivation of this class is to avoid having a client object directly calling the GetObject method to get a prototype object out of an IObjectFactory, which would be a violation of the inversion of control principle. With the use of this class, the client object can be fed an IObjectFactory as a property that directly returns one target prototype object.
The object referred to by the value of the TargetObjectName property does not have to be a prototype object, but there is little to no point in using this class in conjunction with a singleton object.
The following XML configuration snippet illustrates the use of this class...
<objects> <!-- prototype object since we have state --> <object id="MyService" type="A.B.C.MyService" singleton="false" /> <object id="MyServiceFactory" type="Spring.Objects.Factory.Config.ObjectFactoryCreatingFactoryObject"> <property name="TargetObjectName"> <idref local="MyService" /> </property> </object> <object id="MyClientObject" type="A.B.C.MyClientObject"> <property name="MyServiceFactory" ref="MyServiceFactory" /> </object> </objects>
Assembly: Spring.Core (in Spring.Core.dll)