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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -