//Define the Person Object.
//The Person class (object) defines the structure for a person data object.
//The Person class (object) contains the CompareTo() method which will invoke the CompareTemplateMethod() method in the Template Method class.
public class Person : IComparable
{
public string Firstname { get; private set; }
public string LastName { get; private set; }
public Person(string firstName, string lastName)
{
Firstname = firstName;
LastName = lastName;
}
public int CompareTo(object obj)
{
Algorithm<Person> algoPerson = new Algorithm<Person>();
return algoPerson.CompareTemplateMethod(this, obj);
}
}