Example #1
0
 static void Main(string[] args)
 {
     // adapts an old or incompatible method into an excpected result.
     // https://en.wikipedia.org/wiki/Adapter_pattern
     IPerson person = new PersonAdapter(new OldPerson());
     Console.WriteLine("This person is {0} years old.", person.GetAge());
     Console.ReadLine();
 }
Example #2
0
        static void Main(string[] args)
        {
            // adapts an old or incompatible method into an excpected result.
            // https://en.wikipedia.org/wiki/Adapter_pattern
            IPerson person = new PersonAdapter(new OldPerson());

            Console.WriteLine("This person is {0} years old.", person.GetAge());
            Console.ReadLine();
        }