Bertrand Meyer wrote:
> I don't know the library, but contracts don't go well with aspects (they
> don't crosscut):
>
>
http://se.ethz.ch/~meyer/publications/lncs/aspects_contracts.pdfThat's an interesting study. I have no experience with AspectJ, but my
experience with Extensible C# was much better in two respects:
* I was able to express pre- and post-conditions directly within the class
text, immediately above the method to which they applied.
* These pre- and post-conditions were inherited by overriding methods.
The study's example contract would be written something like this:
| [Old("double x, y")]
| [Ensure("x == old x + delta_x")]
| [Ensure("y == old y + delta_y")]
| public void moveBy(double deltaX, double deltaY){
| x += deltaX;
| y += deltaY;
| }
(Well, I tell a lie here, because it didn't support Eiffel's "old" notation,
although I did have plans to extend it to allow the kind of declaration you
see above. It's very extendible, a fact that I took advantage of to fix
various other deficiencies, but I never did get around to implementing
"old".)
All of the study's other criticisms about AOP not being suitable for DbC
hold for Extensible C#. Extensible C# had several disadvantages that the
study doesn't mention:
* The contract code had to be written within strings, as you see above,
which was then parsed by a post-compiler. This was a bit inconvenient,
because some of the IDE's capabilities were unavailable when writing the
contracts.
* The contracts were considerably less legible than when written in Eiffel.
* Getting started is difficult. In Eiffel, DbC just works, whereas I spent a
week or more overcoming various basic deficiencies in Extensible C#'s
support for contracts.
- Peter Gummer
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/eiffel_software/<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/eiffel_software/join (Yahoo! ID required)
<*> To change settings via email:
mailto:
eiffel_software-digest@...
mailto:
eiffel_software-fullfeatured@...
<*> To unsubscribe from this group, send an email to:
eiffel_software-unsubscribe@...
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/