Ahmed Galal
Ahmed Galal

Reputation: 714

how is the inheritance weakens the Encapsulation

I have a question in object-oriented programming

how is the inheritance weakens the Encapsulation ?

Please I want to understand this point

Upvotes: 0

Views: 293

Answers (1)

Gabriel M
Gabriel M

Reputation: 704

You can find an answer in How inheritance weakens encapsulation chapter of "The Object-Oriented Thought Process" by Matt Weisfeld.

The problem is that if you inherit an implementation from a superclass and then change that implementation, the change from the superclass ripples through the class hierarchy. The rippling effect potentially affects all the subclasses.

Upvotes: 1

Related Questions