|
DesignByContract
DesignByContract lets you specify constraint and checks to your code. IntroductionYou can find an introduction to design by contract here. DetailsCurrent features:
UsageDownload source code from svn repository. Built it and copy Torch.DesignByContract.dll, Torch.DesignByContract.Weaver.dll and Torch.DesignByContract.psplugin to the PlugIns directory under the PostSharp installation location. Reference Torch.DesignByContract.dll from your project. NonNull/NonEmpty [return: NonNull] public SomeObject SomeMethod([NonNull] AnotherObject param1)
{
...
}SingletonDeclaration [Singleton]
public class MySingletonCandidate
{
// default constructor
public MySingletonCandidate()
{
...
}
...
}Using the classJust like any other class, if you are compiling against the plain class (not yet enhaced)MySingletonCandidate obj1 = new MySingletonCandidate();OrMySingletonCandidate obj1 = MySingletonCandidate.Instance;If you are compiling against the enhaced class. Comments to altobarba at gmail dot com, or posting in the postsharp's forum. Ignacio Vivona. |
Sign in to add a comment