Infolinks In Text Ads

Advantages and Disadvantages Of Inheritance

 Inheritance
  • Method of reuse in which new functionality is obtained by
    extending the implementation of an existing object
  •  The generalization class (the superclass) explicitly captures the
    common attributes and methods
  • The specialization class (the subclass) extends the implementation
    with additional attributes and methods
Advantages and Disadvantages Of Inheritance:
Advantages:
  • New implementation is easy, since most of it is inherited
  • Easy to modify or extend the implementation being reused
Disadvantages:
  • Breaks encapsulation, since it exposes a subclass to implementation details
    of its superclass
  • "White-box" reuse, since internal details of superclasses are often visible to
    subclasses
  • Subclasses may have to be changed if the implementation of the superclass
    changes
  • Implementations inherited from superclasses can not be changed at runtime

Newer Post Older Post

Leave a Reply

Powered by Blogger.