int param = 2; Object obj Ctor Args = new Object ; object My Class = Activator. Invoke Method, null, My Class, args) This sample will invoke a method called Compute Sum on an instance of the specified Type contained in an assembly. NET Framework provides a series of classes that make it easy to load external assemblies, query the assembly manifest for Type information, create instances of objects of those Types, and invoke members.Create Instance(type, obj Ctor Args); object  args = new object  ; object result; result =typet. To get all of this necessary information into the application, you still have to compile the application.Using the is keyword means that it attempts to convert the object to the specified Type.
Coding validation rules in DLLs apart from the rest of the system allows you to update the rules without rebuilding the entire application, but you have to stop the application to replace the DLLs.
In addition, the inherent lack of Type safety in calling DLL methods and having to load them using Load Library and Get Proc Address results in code that is difficult to understand and maintain.. At Brierley & Partners we've developed a set of classes and interfaces to perform data validation in a fraction of the time it would take using traditional C and/or COM components.
In this example foo is an instance of a class of Type Foo.
Foo implements the IValidator interface, so "v" is not null.
An interface is like a class in which every member is abstract; it can only contain property and method declarations without function bodies.
An interface may not contain field declarations, initializer declarations, or nested class declarations. A class may extend only one base class, but a class may implement many interfaces.
Each programmer has developed his or her own method of validating input data in varying degrees of complexity, but generally, this has resulted in coding the data validation rules into the procedural or object code.
This has meant re-compiling and re-distributing your application each time the validation rules changed.
Jonathan Schafer is an Architect at Brierley & Partners.
Jonathan has 15 years experience designing and developing distributed applications in the Microsoft environment, and two and a half years experience with . Jonathan is currently architecting systems for client applications. ( is a direct marketing agency specializing in the design and implementation of customer relationship programs.
Once you've created that instance you can call any public method passing the information retrieved.