Alex, a software engineer, is architecting his application, composed of two C# projects: a data layer and a UI layer. His goal today is to choose tools and patterns that reduce boilerplate code and minimize human errors.
In the data layer, Alex utilizes Metalama.Patterns.Caching
which encompasses three aspects: [Cache]
for smart caching strategies, [InvalidateCache]
to purge cache entries, and [CacheKey]
for designating key properties. While these are applied broadly, Metalama's licensing zeroes in on the class count rather than usage scope.
For the UI layer, Alex integrates [Observable]
and [Memoize]
aspects, adding just two aspect classes to this C# project.
Alex also incorporates contract-based aspects such as [NotEmpty]
and [Range(0,100)]
, which, thanks to their inheritance from ContractAspect
, don't tally in the aspect class count.
Despite Alex's solution using five aspect classes, each individual project remains within the three-class limit, fitting neatly within the Metalama Free tier.
As the project evolves and Metalama's virtues become more apparent, Alex is compelled to adopt additional aspects like [Log]
for logging, [Cloneable]
for cloning objects, and [Invariant]
for maintaining invariants, increasing the data layer's aspect class count to six.
To meet these expanded needs, Alex transitions to Metalama Professional, which accommodates up to 10 aspect classes and unlocks comprehensive features such as programmatic architecture validation and an advanced aspect testing framework.
Now fully embracing Metalama, Alex not only increases productivity, but also enhances the codebase quality.
All aspects integrate seamlessly, bringing his projects closer to the ideal of clean and maintainable code. With Metalama's advanced architectural validation at his disposal,
Alex confidently tackles complex refactoring challenges, and his application thrives. It's a success story that begins with a thoughtful choice of tools and culminates in the realization of a robust, future-proof architecture.