Let's get back to the crux of our problem: given an interface, how do we obtain a concrete implementation of a class that is currently implementing it?
In Chapter 3, Interfaces, Classes and Generics, we wrote a generic class named
InterfaceChecker that did a runtime evaluation of a class, to check whether it implemented a specific set of methods and properties. The basic idea behind this
InterfaceChecker was that if we provided a metadata class that listed the expected properties and methods of an interface, we could then interrogate a class at runtime against this metadata. If the class had all of the required properties and methods, then it was said to implement the interface.
So, we now have a mechanism—at runtime—to ensure ...