Personal Understanding: in short, assembly. createinstance is an encapsulated activator. createinstance method. The former is more secure, and the latter is more widely used.
Assembly. createinstance method (string)
Use case-sensitive searches.ProgramSearch for the specified type, and then use the system activator to create its instance.
Activator. createinstance method (type)
Create an instance of the specified type using the constructor with the highest degree of matching with the specified parameter.
By default, dalfactory encapsulates each layer into an assembly (Independent Project
) Component. Creates an object instance through the reflection mechanism.
//Create an object instance from an assembly
String Path = system. configuration. configurationsettings. receivettings ["Dal"]; // The Assembly name at the data layer.
Return (idbobject) Assembly. Load (PATH). createinstance (path + ". dbobject ");
If your data layer is not a separate assembly, you can load it as follows:
//Create an instance of the specified type using the constructor with the highest degree of matching with the specified parameter
String Path = system. configuration. configurationsettings. receivettings ["Dal"];
String typename = path + ". dbobject"
Type objtype = type. GetType (typename, true );
Return (idbobject) activator. createinstance (objtype );
Reference: http://www.cnblogs.com/SAL2928/archive/2009/04/27/1444761.html