There are two systems for drugs classification:
1). Classification by chemical family (e.g. terpenoids, alkaloids, etc.).
2). Classification by biological activity (e.g. vitamins, antibiotics, etc.).
But both classification systems have their own ads and cons:
1). Although being more convenient for chemists, members of the same chemical family or even enantiomers may have different biological activity (e.g. quinine and quinidine).
2). Although being more convenient for physicians, the activity classification is sometimes unsuccessful (e.g. sulfonamides that are not antibiotics but often classified as antibiotics).
Therefore, it is actually preferred the (unofficial up to date) drugs classification by generations that indicates both biological activity and the chemical structure; and often the adverse effects (e.g. antibiotics).