i. Main disadvantage of using inheritance is that the two classes (base and inherited class) get tightly coupled.
ii. This means one cannot be used independent of each other.
iii. Also with time, during maintenance adding new features both base as well as derived classes are required to be changed.
iv. i.e. If a method signature is changed then we will be affected in both cases (inheritance & composition)
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
v. Either of both of them are changed to accommodate changes.
vi. This further makes them more tightly coupled and lots of contextual information tends to be added.
vii. If a method is deleted in the "super class" or aggregate, then we will have to re-factor in case of using that method.Here things can get a bit complicated in case of inheritance because our programs will still compile, but the methods of the subclass will no longer be overriding superclass methods. These methods will become independent methods in their own right.
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteJava Training in Chennai Java Training in Chennai | Core Java Training in Chennai | Java Training Institutes
Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai