inheritance - Why do we use Base classes in Java -
while doing desing/framework usual practice have base class value objects, services, daos etc. example if create new vo, extends basevo. if create new dao, should extend basedao. reason why have such base class?
inheritance, encapsulation , polymorphism, 1 of 3 primary characteristics of object-oriented programming. inheritance (inheriting base class) enables create new classes reuse, extend, , modify behavior defined in other classes.
it easy add common methods , properties base class. that's not correct way cases. design patterns (like strategy pattern) uses above mentioned oop concepts real designing.
Comments
Post a Comment