OOP Design Patterns— Composite Pattern

  • Decorator Pattern — Attaches additional responsibilities dynamically(in runtime) without opening up. supporting open-closed principle
  • Composite Pattern — Used when data is hierarchical by nature — replace conditionals with polymorphism

--

--

--

Engineer, traveller, writer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

React India Map / React Any country Map

Devlog — Week 6

PUT request to Django API to update list of nested objects with Many To Many relationships

iorad → Intercom Article

Day 2 (100 Days of code)

NextJs Firebase v9 Part 14: Add a Login Page

How to separate front-end to React in huge legacy application in 5 steps

Difference between React js and Angular: A comparison guide for 2022

Difference Between React js and Angular 2022

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dinesha Karunathilake

Dinesha Karunathilake

Engineer, traveller, writer

More from Medium

Features of resource-dashboard, user-assignment and task-overview templates

Omniverse — A brief view

What should be done in the first turn: reengineering or migration?

TRAPPING IN LONDON