Why do program texts always use the Employee object?

Is there anything special in the essence of Employee that makes it desirable to use it so often in programming texts?

Are there any other objects that will serve just as well?

+3
source share
3 answers

Obviously, anything that points to a hierarchy will be helpful; An employee is used because it is the most common and trivially understandable conceptually (i.e., easy to visualize). Harder to visualize B : A.

If it is not obvious; it was used because it is useful for studying OO in terms of hierarchy / polymorphism functions and allows it to refer directly to what almost everyone has experience with.

+3

, , Animal . , , , " "!

+2

All about the hierarchy. Student / Teacher / Classes / School work too.

0
source

Source: https://habr.com/ru/post/1731962/


All Articles