Delegation principle
A design principle in which one class assigns work to another whose responsibilities make it more suitable for performing that work.
Software Design for Python Programmers
The Delegation Principle assigns work to another class whose responsibility and cohesion make it more suitable for performing that work.
- How it is used
- Uses delegation to assign work to the class whose responsibility and cohesion make it most suitable.
- How deep it goes
- Defines requester and delegate roles, demonstrates a Catalogue refactoring, and connects delegation to runtime-selectable strategies.
- Examples
- Uses Catalogue, Book, and Attributes for matching, then Sport with player and venue strategies for algorithm selection.
- What you can do after
- Apply it by extracting cohesive work into delegate objects and invoking them through stable requester methods.
Read how Software Design for Python Programmers explains delegation principle →
Object-Oriented Software Design in C++
A design principle in which one class assigns work to another class whose cohesive responsibilities make it more suitable to perform that work.
- How it is used
- Applies delegation while refactoring Catalogue to achieve cohesion and loose coupling.
- How deep it goes
- Defines requester–delegate roles and demonstrates one C++ search refactoring, stopping short of broader implementation guidance.
- Examples
- Uses a book Catalogue, Book objects, Attributes objects, and attribute-based searches as concrete delegation examples.
- What you can do after
- Apply it via cohesive classes that request specialized work without depending on the delegate's implementation.
Read how Object-Oriented Software Design in C++ explains delegation principle →
Related concepts
- sportused by · A sport is an organized competitive athletic discipline comprising one or more events.
- iteratorused by · An iterator is an object or abstraction that provides successive values from a sequence or data source through a traversal protocol.
- principlekind of · A principle is a general rule, guideline, or value that guides decisions, behavior, or judgments.
- couplingimplements · Coupling is the degree of dependency between software components, including how their behavior, availability, or changes affect one another.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

