There was an error while loading. Please reload this page.
2 parents 6ff38db + 21d6b7e commit 3ea0a93Copy full SHA for 3ea0a93
1 file changed
behavioral/chain.py
@@ -2,7 +2,22 @@
2
# -*- coding: utf-8 -*-
3
4
"""
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:
16
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.
21
22
23
from contextlib import contextmanager
0 commit comments