Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 1018 Bytes

File metadata and controls

12 lines (8 loc) · 1018 Bytes

Video 1.8: Issues faced due to force fitting everything in object inheritance

In the branch, inheritance is expalined with its issues. Needs Java 9 and mongodb setup to run the example.

Definition of inheritance

Inheritance is a mechanism in which one object acquires all the properties and behaviours of the parent object. Inheritance allows programmers to create classes that are built upon existing classes, to specify a new implementation to maintain the same behaviour to reuse code.

Issues with inheritance

The main problem with implementation inheritance is that it introduces unnecessary coupling in the form of the "fragile base class problem" modifications to the base class implementation can cause inadvertent behavioral changes in subclasses, creates strong coupling and loose flexibility.

DesignPatternsJava9

This repo consists Gang of Four Design patterns code on Java 9. Each branch in the repository has code of 1 design pattern. Switch repository to try out different design patterns.