Compare objects by their attributes