Drugs like aspirin can be classified on the basis of:
Pharmacological effect
Analgesics are drugs which have pain killing effect. For example Aspirin and morphine acts on different targets and have no structural relationship. Drugs like aspirin can be classified on the basis of pharmacological effect.