Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generalization and Specialization - What is the differences

Tags:

architecture

I am having a hard time actually finding the difference between a Generalization and a Specialization, and when to use either one.

Can anyone enlighten me?

Eventually also an illustration using UML

like image 383
Patrick Reck Avatar asked Nov 04 '25 02:11

Patrick Reck


1 Answers

Animal is a generalization , Dog is specialization. Your superclass is a generalized class , but your subclass will be a specialized inheritor of your superclass. It becomes more specialized and less generalized as you move down the inheritance hierarchy .

Generalization

Generalization is the process of extracting shared characteristics from two or more classes, and combining them into a generalized superclass. Shared characteristics can be attributes, associations, or methods.

Specialization

If some new subclasses are created from an existing superclass to do specific job of the superclass, then it is known as specialization.

You can get more clear tutorial with UML diagrams here.

like image 186
AllTooSir Avatar answered Nov 06 '25 03:11

AllTooSir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!