What is Laos?
PostSharp Laos [Lightweight Aspect-Oriented System] makes
aspect-oriented programming easy. All you have to do is to derive a
custom attribute and to apply it to methods using wildcards. Laos
users only need a superficial knowledge of
System.Reflection.
The objective of PostSharp Laos is to bring aspects to people who do not even know what an aspect is. Everyone in .NET knows that a custom attribute is "something that modifies a behavior" and PostSharp Laos allows to modify a behavior in a natural way.
The goal is not to provide a complete, full-featured aspect weaver but to focus on simplicity and usability.
Getting started
Install PostSharp and look at the Quick Start sample. It's a matter of minutes.
In this section
Each of these aspects support the following features:
Aspects Kinds
Instead of method call, implementation of external or abstract
methods, interception of field accesses, exception handlers, object
composition, ...
Aspect Lifetime
Aspects have an unusual lifetime: they instantiated at
compile-time, serialized into the assembly, and deserialize at run
time. Understanding this is crucial to any serious PostSharp Laos
user.
Wildcards & Attribute
Multicasting
Using a mechanism named custom attribute multicasting, you can
apply a custom to many methods or fields in a single line of code
using wildcards.
Compile-Time Validation
As an aspect developer, you can prevent aspect users to apply it
where they should not.
Compound Aspects
It is possible to develop aspects that are composed of many atomic
transformations.