Author: you've been HAACKED | Posted on: 11/10/2009 11:43:13 AM | Views : 817

I learned something new yesterday about interface inheritance in .NET as compared to implementation inheritance. To illustrate this difference, here?s a simple demonstration. I?ll start with two concrete classes, one which inherits from the other. Each class defines a property. In this case, we?re dealing with implementation inheritance . public class Person { public string Name { get; set; } } public class SuperHero : Person { public string Alias { get; set; } } We can now use two different techniques to print out the properties of the SuperHero type: type descriptors and reflection. Here?s a little console app that does this. Note the code I?m showing below doesn?t include a few Console.WriteLine calls that I have in the actual app. static...(read more) ...

Go to the complete details ...