paint-brush
Difference Between Inheritance And Compositionby@dm8typrogrammer
409 reads
409 reads

Difference Between Inheritance And Composition

by The Mighty Programmer4mOctober 15th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

With the introduction of OOPs, Inheritance and Composition are still confusing us. Composition and Inheritance are the building blocks of an application structure. Inheritance is a way of reusing code by inheriting the structure from the referred class or Type. Compositions are more suitable in this context as it is expected to have structural similarity or uniformity. In Inheritance, the structure imposition introduces tight coupling between both connected classes; it restricts their future editing. Composition does not impose any structure of any of connected Class. It is a flexible option.

Company Mentioned

Mention Thumbnail
featured image - Difference Between Inheritance And Composition
The Mighty Programmer HackerNoon profile picture
The Mighty Programmer

The Mighty Programmer

@dm8typrogrammer

Writing about Software Design and Software Engineering

Learn More
LEARN MORE ABOUT @DM8TYPROGRAMMER'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

The Mighty Programmer HackerNoon profile picture
The Mighty Programmer@dm8typrogrammer
Writing about Software Design and Software Engineering

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Joyk
Special-thai
Learnrepo
Coffee-web
Rhino-universal