🎉 Hooray! After 3 years of work, I've finally released the ebook on design patterns! Check it out »
Chain of Responsibility

Chain of Responsibility in Swift

Chain of Responsibility is behavioral design pattern that allows passing request along the chain of potential handlers until one of them handles request.

The pattern allows multiple objects to handle the request without coupling sender class to the concrete classes of the receivers. The chain can be composed dynamically at runtime with any handler that follows a standard handler interface.

Learn more about Chain of Responsibility

Usage of the pattern in Swift

Complexity:

Popularity:

Usage examples: The Chain of Responsibility pattern isn’t a frequent guest in a Swift program since it’s only relevant when code operates with chains of objects.

Identification: The pattern is recognizable by behavioral methods of one objects indirectly call the same methods in other objects, while all the objects follow the common interface.

Chain of Responsibility in Other Languages

Design Patterns: Chain of Responsibility in Java Design Patterns: Chain of Responsibility in C# Design Patterns: Chain of Responsibility in PHP Design Patterns: Chain of Responsibility in Python Design Patterns: Chain of Responsibility in Ruby Design Patterns: Chain of Responsibility in TypeScript