Can I dish out multiple interface implementations from Base as properties to derived classes?

  • Thread starter Thread starter Highlander4
  • Start date Start date
H

Highlander4

Guest
I'm using a base class that inherits from multiple interfaces, however, I'm not sure if what I'm doing is an acceptable practice.

I have multiple interfaces implemented in this fashion and so far I haven't had a problem. From base I pass implementing classes as properties to derived classes.


public interface IFirst { void FirstMethod(); }

public class First:IFirst
{
public void FirstMethod() { Console.WriteLine("First"); }
}

public class BaseClass{
IFirst first = new First()


Public IFirst bcFirst // this property distributes the interface implementing class to derived classes

{

{get{return first;}

}

}


NR

Continue reading...
 
Back
Top