Validate your design at each build against standard and custom rules.
Don’t let the intention of your architecture fade in a forgotten document. Express design decisions in executable code and ensure that these patterns are followed with compile-time feedback.
- Code level declaration
- Compile time feedback
- Customizable rules
Simplicity lies in consistency.
Enforce Design Decisions
Reduce inconsistency – Validate developer-written code against established patterns and guidelines. Prevent developer distraction or inventiveness from creating defects or unwanted complexity.
Control object visibility – Sometimes internal and private keywords are not enough. Restrict which namespace, assembly or type can reference a member or implement an interface.
Save time during code reviews – Any rule that is automatically enforced does not need to be reviewed manually.
Get Faster Feedback
Compile-time errors – Don’t wait to get feedback from a code review. Fail at compilation time when code deviates from an established pattern or guideline.
Build server integration – Architecture rules are executed on the build server too, just as any part of PostSharp.
Errors or warnings – You can choose violations to result in warnings or errors – or warnings in Visual Studio and errors on the build server.
Build Your Own Rules
Familiar API – Create validation for your specific design rules using the .NET reflection API that you already know.
Advanced Reflection – For more complicated scenarios, PostSharp offers an extended reflection API that includes the ability to Find All References, Find Derived Types, Visit Expression Trees and more.
Visual Studio Integration – Errors and warnings emitted by custom rules will be displayed in the Visual Studio Error List, and you can navigate to the problem location by clicking on them.