Dynamic Assembly Loader

Intent

Provide a pattern to simplify dynamic loading, interrogation, and caching of the types contained in an assembly.

Problem

The .NET framework provides a fairly complete set of classes to load and interrogate an assembly. This pattern enhances this functionality to simplify the retrieval of the type information from an assembly.

Once loaded, rarely will a type be used only once. This pattern will eliminate the need to return to the assembly each time the type is needed.

Finally, when dynamically loading assemblies, the client application will typically be looking for a specific interface in the assembly. Because of this, a method is provided to retrieve only classes that implement a specific interface.

Forces

Use the ...

Get .NET Patterns: Architecture, Design, and Process now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.