Decorator Design Pattern

Photo by Iza Gawrych on Unsplash
  • Where we need to add new features to an object
  • Where we need to change the behavior of the object without modifying the code

Elements of Decorator Desing Pattern

Decorator Design Pattern’s UML

How to Add New Feature with Decorator Design Pattern?

Component & Concrete Component
Decorator & Component & Concrete Component
Concrete Decorator & Decorator & Component & Concrete Component

How to Change Object’s Behavior with Decorator Design Pattern?

--

--

--

var software = ConvertFrom(caffeine)

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

Recommended from Medium

How to secure Kubernetes in-cluster communication

AWS re:Invent 2019 — A Recap

Yet Another Akka Streams Post: Realtime Twitter Top Words

CS373 Spring 2022: Nisha Ramesh

CKAD Scenarios Deployment Rollout Strategies

Amazon EKS -Elastic Kubernetes Service

System Design Interview Prep: How to Build a System to Handle Long Running Job

Pick a framework !

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
Adem Catamak

Adem Catamak

var software = ConvertFrom(caffeine)

More from Medium

Pure Functions in Software Development

Designing Software Using Clean Architecture: Domain-Driven Design

Create well designed application with Unified Identity

Observer Pattern