public interface IController
{
string GetName();
}
public interface IAggInterface
{
string GetInnerName();
}
public class Aggregate:IAggInterface
{
public string GetInnerName()
{
return "Aggregate";
}
}
public class AggregationPattern:IController,IAggInterface
{
protected IAggInterface aggObj;
public AggregationPattern()
{
aggObj = new Aggregate();
}
public string GetName()
{
return "Controller";
}
public string GetInnerName()
{
return aggObj.GetInnerName();
}