Chapter 12. Chain of Responsibility

Object-oriented developers strive to keep objects loosely coupled, keeping the responsibility between objects specific and minimal. This lets you introduce change more easily and with less risk of introducing defects. Decoupling occurs naturally in C#, to a degree. Clients see only an object's visible interface and remain isolated from the details of the object's implementation. This arrangement, however, leaves in place the fundamental coupling that the client knows which object has the method the client needs to call.

You can loosen the restriction that a client must know which object to use when you can arrange a group objects in a kind of hierarchy that allows each object to either perform an operation or ...

Get Design Patterns in C# now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.