usingSystem;
usingSystem.Collections.Generic;
usingSystem.Text;
namespaceDISimple
{
classProgram
{
staticvoidMain(string[] args)
{
InputAccept accept
=newInputAccept(newPromptDataProcessor());
accept.Execute();
Console.ReadLine();
}
}
publicclassInputAccept
{
privateIDataProcessor _dataProcessor;
publicvoidExecute()
{
Console.Write("Please Input some words:");
stringinput = Console.ReadLine();
input = _dataProcessor.ProcessData(input);
Console.WriteLine(input);
}
publicInputAccept(IDataProcessor dataProcessor)
{
_dataProcessor = dataProcessor;
}
}
publicinterfaceIDataProcessor
{
stringProcessData(stringinput);
}
publicclassDummyDataProcessor : IDataProcessor
{
#region IDataProcessor Members