feat(decorator): implemented the decorator pattern.#49
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements the decorator pattern for PatternKit, providing a fluent, allocation-light way to wrap components with layered behavior enhancements. The implementation supports before/after transformations and around wrappers for cross-cutting concerns like logging, caching, and validation.
Key changes:
- Core
Decorator<TIn, TOut>implementation with fluent builder API - Comprehensive Point of Sale example demonstrating real-world usage
- Full test coverage with TinyBDD scenarios
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/PatternKit.Core/Structural/Decorator/Decorator.cs |
Core decorator implementation with fluent builder pattern |
src/PatternKit.Examples/PointOfSale/ |
Complete Point of Sale example demonstrating decorator composition |
test/PatternKit.Tests/Structural/Decorator/DecoratorTests.cs |
Comprehensive test suite covering all decorator scenarios |
test/PatternKit.Examples.Tests/PointOfSale/PaymentProcessorTests.cs |
Integration tests for Point of Sale example |
docs/patterns/structural/decorator/ |
Complete documentation including examples and API reference |
src/PatternKit.Generators/packages.lock.json |
Updated dependency lockfile for additional target frameworks |
README.md |
Updated to include decorator pattern examples and table |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Code Coverage |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #49 +/- ##
==========================================
+ Coverage 81.96% 83.27% +1.30%
==========================================
Files 42 46 +4
Lines 2662 3252 +590
Branches 446 497 +51
==========================================
+ Hits 2182 2708 +526
- Misses 322 544 +222
+ Partials 158 0 -158
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.