educative.io

Badge as Abstract class?

can we make Badge as Abstract class since Badge is of many types like bronze silver gold etc. and each badge is having different allocation criteria ?


Course: https://www.educative.io/courses/grokking-the-low-level-design-interview-using-ood-principles
Lesson: Class Diagram for Stack Overflow - Grokking the Low Level Design Interview Using OOD Principles

Hi @Narayan_khanna ,

Yes, the Badge class can be made into an abstract class. It depends on the level of detail you want to go in your design. It is also possible you make a BadgeType enumeration to record whether it’s Gold , Silver , or Bronze . Design problems don’t have a definite solution. We can always tweak them based on our understanding and of course, the requirement set.

Happy Learning :slight_smile: