|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RightComposition.ClassesAndInterfaces
{
public class Leader:IEmployee,IPrinterEnabled
{
private string name;
private int experience;
private IPrinterCommand printManager;
#region IEmployee Members
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
public int Experience
{
get
{
return experience;
}
set
{
experience = value;
}
}
#endregion
#region IPrinterEnabled Members
public IPrinterCommand PrintManager
{
get
{
return printManager;
}
set
{
printManager = value;
}
}
#endregion
public Leader()
{
name = "Leader";
experience = 5;
//Note: We can inject information for concrete object IPrinterCommand from outside, but object initialization
// is not focus of article I have hardcoded it here.
//In practical world this printer object will be set from outside place, allowing plug and play.
printManager = new AveragePrinter();
printManager.Initialize();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.