the former... make an icomparer that compares the record id, another icomparer that comapres the class id and another that compares the sort order.
The reason why is, if you have a bunch of objects stored in an arraylist, you can just pass the icomparer instance to the arraylist.sort method.