Open sandboxFocusImprove this doc

Metalama Patterns

Metalama Patterns, housed under the Metalama.Patterns namespace, consist of libraries of aspects that implement the most common design patterns for C#.

Constructed by the Metalama team, these patterns uphold the same quality standard 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
Metalama.Extensions.DependencyInjection Although this package is primarily designed to make it easy for aspect authors to integrate dependency injection, it also contains an aspect that automatically pulls dependencies from fields and properties. Supports lazy loading.
Metalama.Patterns.Contracts Implements Contract-Based Programming via preconditions, postconditions, and invariants. This aids in building maintainable, reliable, and scalable software systems.
Metalama.Patterns.Caching Combines object-oriented and aspect-oriented APIs.
Metalama.Patterns.Memoization Implements a simple and high-performance alternative to caching limited to get-only properties and paramerless methods.
Metalama.Patterns.Immutability Represents the concept of Immutable Type.
Metalama.Patterns.Observability Contains an aspect that implements the INotifyPropertyChanged interface. Supports explicit properties, type inheritance, and child objects.
Metalama.Patterns.Wpf Two aspects to simplify the work with WPF: Command and Dependency Property.