Reflection and Interfaces

Today is the last official installment in the series on reflection.  If you’ve been following along, you’ve probably notice that calling code in other classes using reflection is a huge pain in the butt.

Today, we are going to take a look at a way of taking advantage of some of the benefits of reflection without having to jump through all of the hoops that reflection puts in our way. We will do this by using interfaces.  This tactic works if you know ahead of time what methods and properties your class will need but want to be able to dynamically load them at runtime.  A classic example of this would be plugins.

Related Post

Comments are closed.