Introduction to OOP Chapter 21: Software Frameworks : next previous audio real text

Specializing the Sorting Framework

To apply the framework to a new problem, we subclass and override the deferred methods:
class EmployeeSorter : public InsertionSorter {
public:
	EmployeeSorter (Employee * d[], int n) 
		{ data = d; sze = n; }
private:
	Employee * data[];
	int sze = n;

	virtual int size () { return sze; }

	virtual bool lessThan (int i, int j) 
		{ return data[i]->startingYear < data[j]->startingYear; }

	virtual void swap (int i, int j) {
		Employee * temp = v[i];
		v[i] = v[j];
		v[j] = temp;
	}
}
We can now reuse the high level algorithm without making any change to the original source code!
Intro OOP, Chapter 21, Slide 10