///
/// Entry point into console application.
///
static void Main()
{
CEmployee objCEmployee
objCEmployee = new CManager();
objCEmployee.DefineWork();
objCEmployee = new CDeveloper();
objCEmployee.DefineWork();
}
///
/// The 'Strategy' abstract class
///
abstract class CEmployee
{
public abstract void DefineWork();
}
///
/// A 'ConcreteStrategy' class
///
class CManager : CEmployee
{
public override void DefineWork()
{
Console.WriteLine("This is Manager Works.");
}
}
///
/// A 'ConcreteStrategy' class
///
class CDeveloper : CEmployee
{
public override void DefineWork()
{
Console.WriteLine( "This is Developer Work.");
}
}
No comments:
Post a Comment