DesignByContract Aspect
2 posts • Page 1 of 1
DesignByContract Aspect
Hi Gael,
i'd like to write a DesignByContract Aspect. I create a OnMethodBoundaryAspect which is call like this:
At compile time I like to create a class which the DbcAspect is calling when it check at runtime the contract. I know how should I create a class at compiletime (codeDom) but i don't know how can I add this class to the assembly where the contract ist defined.
I hope you understand my problem and can help me.
i'd like to write a DesignByContract Aspect. I create a OnMethodBoundaryAspect which is call like this:
- Code: Select all
[DbcAspect("(TestInt1>50)", ContractType.Initial)]
At compile time I like to create a class which the DbcAspect is calling when it check at runtime the contract. I know how should I create a class at compiletime (codeDom) but i don't know how can I add this class to the assembly where the contract ist defined.
I hope you understand my problem and can help me.
- PatrixJ
- Posts: 4
- Joined: Fri Jan 25, 2008 10:56 am
- Full Name: Patrick Jahnke
Re: DesignByContract Aspect
Hi Patrick,
You cannot use CodeDom, unfortunately. Or if you use CodeDom, you have to generate another assembly and refer to it.
If you want to create a new class, you have to use the low-level APIes (PostSharp Core). Ruurd Boeke has written a great tutorial about how to extend PostSharp Laos with PostSharp Core.
Good luck!
Gael
You cannot use CodeDom, unfortunately. Or if you use CodeDom, you have to generate another assembly and refer to it.
If you want to create a new class, you have to use the low-level APIes (PostSharp Core). Ruurd Boeke has written a great tutorial about how to extend PostSharp Laos with PostSharp Core.
Good luck!
Gael
Gael Fraiteur, project leader
got good support? consider donating to the project.
got good support? consider donating to the project.
- gfraiteur
- Site Admin
- Posts: 581
- Joined: Tue Dec 18, 2007 3:09 pm
- Full Name: Gael Fraiteur
- Company: postsharp.org
2 posts • Page 1 of 1