Metalama Technical Guide
Scope: All developers working with the GST framework (
GST.Core.Aspects)Audience: New developers, partners, and anyone learning Metalama-based AOP
Prerequisites: Basic C# and .NET knowledge
Estimated Reading Time: 2–3 hours (full guide)
Version: 1.0
Last Updated: 2026-03-31
Metalama Version: 2025.1.17 (GST) / 2026.1 (latest)
What This Guide Covers
This guide is a comprehensive introduction to Metalama, a compile-time Aspect-Oriented Programming (AOP) framework for C#. It is designed for developers who are new to AOP or Metalama and want to understand the technology deeply — from foundational concepts to real-world usage in the GST framework.
Guide Structure
| Chapter | Topic | Description |
|---|---|---|
| 1 | Overview (this page) | What this guide is and how to use it |
| 2 | AOP Fundamentals | What AOP is, why it matters, and key terminology |
| 3 | Getting Started | Installation, setup, and your first aspect |
| 4 | Core Concepts | How aspects work, lifecycle, ordering, and composition |
| 5 | T# Template Language | The compile-time template system that powers Metalama |
| 6 | Aspect Base Classes | All base classes explained with examples |
| 7 | Fabrics | Bulk aspect application without attributes |
| 8 | Pattern Libraries | Built-in patterns: Contracts, Caching, Observability |
| 9 | GST Real-World Examples | How the GST framework uses Metalama in production |
| 10 | Advanced Topics | Advising, member introduction, eligibility, diagnostics |
| 11 | Testing & Debugging | How to test and debug aspects and transformed code |
| 12 | Advantages & Disadvantages | Honest assessment of when to use (and not use) Metalama |
| 13 | Best Practices | Design principles, common pitfalls, and guidelines |
How to Read This Guide
For Absolute Beginners
Start with Chapter 2 (AOP Fundamentals) to understand the problem that AOP solves. Then proceed through Chapter 3 (Getting Started) and Chapter 4 (Core Concepts) before exploring the rest.
For Experienced C# Developers New to AOP
Skim Chapter 2 for terminology, then dive into Chapter 3 and Chapter 5 (T# Templates) — the template language is the most unique aspect of Metalama and the key to mastering it.
For Developers Already Familiar with PostSharp or Other AOP Frameworks
Jump to Chapter 5 (T# Templates), Chapter 6 (Base Classes), and Chapter 12 (Pros & Cons) for a comparison with other frameworks.
For GST Framework Users
Chapter 9 (GST Real-World Examples) is essential reading. It explains the architecture, conventions, and all 32 aspects available in GST.Core.Aspects. Pair it with the GST Aspect Usage Guide for project-level rules.
Related Documents
| Document | Description |
|---|---|
| GST Aspect Usage Guide | Rules and conventions for using GST aspects in application projects |
| GST Framework Guide | Overall GST framework architecture and concepts |
| Metalama Official Docs | Official Metalama documentation |
| Metalama GitHub | Source repository |
Version History
| Version | Date | Changes |
|---|---|---|
| 1.0 | 2026-03-31 | Initial release — complete guide covering Metalama 2025.1/2026.1 |