"Inheritance break Encapsulation "

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pallav singh

    "Inheritance break Encapsulation "

    Hi

    i find Following statement while reading Design pattern in C++
    ( author - Erich Gamma)
    "Inheritanc e break Encapsulation " because inheritance exposes to
    subclass the detail of its parent's Implementation
    Is it correct ???

    as we only expose interface ( function prototype) to derived class But
    not how it being implemented

    Kindly give urs View regarding it

    Thanks
    Pallav
  • paul

    #2
    Re: "Inheritan ce break Encapsulation "

    On Jul 16, 10:24 am, Pallav singh <singh.pal...@g mail.comwrote:
    Hi
    >
    i find Following statement while reading Design pattern in C++
    ( author - Erich Gamma)
    "Inheritanc e break Encapsulation " because inheritance exposes to
    subclass the detail of its parent's Implementation
    Is it correct ???
    >
    as we only expose interface ( function prototype) to derived class But
    not how it being implemented
    >
    Kindly give urs View regarding it
    What you are saying sounds correct, but to precise public inheritance
    allows inheritance of interface while private inheritance allows
    inheritance of implementation.
    Also you should understand in what context the author made the above
    statement. What you've quoted from the textbook seems to be only a
    part of the topic.

    Comment

    Working...