Skip to content

Commit 3ea0a93

Browse files
authored
Merge pull request faif#227 from GiantsLoveDeathMetal/add-about-to-chain
Add description to chain pattern
2 parents 6ff38db + 21d6b7e commit 3ea0a93

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

behavioral/chain.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@
22
# -*- coding: utf-8 -*-
33

44
"""
5+
*What is this pattern about?
6+
This pattern aims to decouple the senders of a request from its
7+
receivers. It does this by allowing a request to move through chained
8+
objects until it is handled by an appropriate receiver.
9+
10+
This is useful as it reduces the number of connections between objects,
11+
since the sender does not need explicit knowledge of the handler, and
12+
the receiver won't need to refer to all potential receivers, but keeps
13+
a reference to a single successor.
14+
15+
*References:
516
http://www.dabeaz.com/coroutines/
17+
18+
*TL;DR80
19+
Allow a request to pass down a chain of objects until an object handles
20+
the request.
621
"""
722

823
from contextlib import contextmanager

0 commit comments

Comments
 (0)