interface, reflection, factory, configuration, the class of direct communication through the interface, to implement the interface of the instance configuration, the configuration file is the interface and implementation (DLL name) corresponding, so that the factory in the creation of the instance can be configured according to the configuration.
public class Facadefactory
{
public static T getobject<t> () where T:ibasefacade
{
Iapplicationcontext CTX = Contextregistry.getcontext ("Promocode.facade");
Return (T) ctx. GetObject (typeof (T). Name);
}
This is an example of a factory this is an example of a configuration file
Little Silver 2015/3/5 17:32:45
<object id= "Imycouponfacade" type= "Payment.Promocode.Facade.MyCouponFacade, Payment.Promocode.Facade"/>
<object id= "Imycouponbackmanagerfacade" type= "Payment.Promocode.Facade.MyCouponBackManagerFacade, Payment.Promocode.Facade "/>
Spring.net IOC----Purpose is to change the interface at any time through the configuration file