You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Chain of Responsibility pattern implementation
Implemented the Chain of Responsibility design pattern with new
classes: `Handler`, `LevelOneHandler`, `LevelTwoHandler`,
`DefaultHandler`, and `Request` in the `DesignPatterns.Chain`
namespace.
Updated `Program.cs` to include a demo showcasing the pattern.
Modified `README.md` to document the pattern, its purpose,
example usage, and test references.
Added `ChainTests` to verify the behavior of the pattern,
ensuring proper handling of requests by different handlers.
Integrated the pattern without affecting existing functionality.
- Chain of Responsibility implementation: `DesignPatterns/Chain/*`
19
20
-`Tests` - xUnit tests covering the examples.
20
21
21
22
Included patterns and brief docs
@@ -157,6 +158,21 @@ Included patterns and brief docs
157
158
img.Display(); // reuses loaded image
158
159
```
159
160
161
+
- Chain of Responsibility Pattern
162
+
- Purpose: Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.
163
+
- Example: `DesignPatterns/Chain/*` contains handlers `LevelOneHandler`, `LevelTwoHandler`, and `DefaultHandler` that process requests of different levels.
0 commit comments