- Notifications
You must be signed in to change notification settings - Fork0
Eleanor68/AspectSharp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is aPROOF OF CONCEPT project which intends to enable the Aspect-Oriented Programming (AOP) for C#.
publicclassClass{publicintProperty{get;set;}publicvoidMethod(){}}publicclassClassExtension:ExtensionBase<Class>{publicClassExtension(Classextension):base(extension){}publicintNewProperty{get;set;}publicvoidNewMethod(){Extension.Method();}}//somewhere in the source codevarc=newClass();c.Property=0;//magic happens behind the scenec.NewProperty=0;c.NewMethod();
The power of this idea is the integration with Design-Time and Background build from Visual Studio. This will allow the developer to see live changes in the Visual Studio.
- The developer creates a new extension class with ExtensionBase as a base class.
- Magic happens behind the scene (actually magic will happen in AspectSharp.targets and AspectSharp.Build.dll).
- The developer sees all the new properties/methods right to the extended class live in Visual Studio.
We are extending theMSBuild
build process with our targets from AspectSharp.targets which will be applied right before compile. Our targets will find all extensions and then all extended classes. Based on the extensions new extended classes will be generated and included into the compiled files. Respectively original extended classes will be excluded from the compiled files. Therefore the generated extended classes will be included in the output assembly.
Anyone is welcome!
AspectSharp is distributed under theGPL-3.0 License.