Skip to main content
CleanCodeMastery

Behavioral Patterns

How objects talk to each other and share responsibilities.

10 lessons · follow them in order, or jump to what you need.

beginner

Chain of Responsibility Pattern: Pass the Request Until Someone Handles It

Learn the Chain of Responsibility pattern with a simple school leave application story, easy TypeScript and C# code, diagrams, tables, and practice tasks.

25 mindesign-patterns · behavioral-patterns
beginner

Command Pattern: Turn Every Action into an Order Slip

Learn the Command pattern through a restaurant order slip story. Simple TypeScript and C# code with undo and redo, diagrams, tables, and practice tasks.

23 mindesign-patterns · behavioral-patterns
beginner

Iterator Pattern: Visit Every Element, One Seat at a Time

Learn the Iterator pattern with a railway ticket checker story. Build a custom iterator in TypeScript, use for...of and generators, plus C# IEnumerable.

25 mindesign-patterns · behavioral-patterns
beginner

Mediator Pattern: The Control Tower That Stops the Chaos

Learn the Mediator pattern with an airport control tower story, simple TypeScript and C# code, MediatR examples, diagrams, tables and easy practice tasks.

25 mindesign-patterns · behavioral-patterns
beginner

Memento Pattern: Save Your Game Before the Boss Fight

Understand the Memento pattern through a video game save point story, with TypeScript and Python undo examples, diagrams, tables and easy practice tasks.

25 mindesign-patterns · behavioral-patterns
beginner

Observer Pattern: Press Subscribe and Ring the Bell

Master the Observer pattern with a YouTube subscribe and bell icon story, TypeScript and C# event code, real software uses, diagrams and practice tasks.

24 mindesign-patterns · behavioral-patterns
beginner

State Pattern: The Fan That Changes Its Mood

Learn the State design pattern with a ceiling fan regulator story, simple TypeScript and C# code, state diagrams, real software examples, and practice.

25 minstate · design patterns
beginner

Strategy Pattern: Cycle, Bus, or Auto — You Choose

Learn the Strategy design pattern with a simple school travel story, easy TypeScript and C# code, runtime swapping, real examples, and practice tasks.

24 minstrategy · design patterns
beginner

Template Method Pattern: Chai and Coffee, Same Steps

Learn the Template Method design pattern with a chai and coffee story, easy TypeScript and C# code, hooks, diagrams, real examples, and practice tasks.

23 mintemplate method · design patterns
beginner

Visitor Pattern: The Doctor Who Visits Every Class

Learn the Visitor design pattern with a school health check-up story, double dispatch made simple, TypeScript and C# code, real examples, and practice.

24 minvisitor · design patterns