Metalama Patterns is a collection of aspect libraries that implement common design patterns for C#. You'll find these libraries under the Metalama.Patterns namespace.
The Metalama team builds and maintains these patterns to the same quality standards as the Metalama framework itself.
Note
Metalama Patterns are released under the open-source MIT license and are available on GitHub.
The following libraries are currently available:
| Library | Description |
|---|---|
| Injecting dependencies | Integrates dependency injection into aspects and provides an aspect that automatically pulls dependencies from fields and properties, with lazy loading support. |
| Metalama.Patterns.Contracts | Implements contract-based programming through preconditions, postconditions, and invariants. |
| Metalama.Patterns.Caching | Caches method results with support for invalidation, dependencies, and distributed backends. |
| Metalama.Patterns.Memoization | Caches property getter and parameterless method results within the object instance. |
| Metalama.Patterns.Immutability | Enforces immutability constraints on types and their members. |
| Metalama.Patterns.Observability | Implements the INotifyPropertyChanged interface with support for explicit properties, type inheritance, and child objects. |
| Metalama.Patterns.Wpf | Simplifies WPF development with command and dependency property aspects. |