On Tuesday 16 October 2001 03:02, [EMAIL PROTECTED] wrote:
> Not quite. iContract preprosesses code with @pre @post and @invariant
> tags and converts it to java code which is then inserted into the class
> itself.
>
> Basically it would take this code
>
> /**
>  * @pre celcius > -273.15
>  */
> public double convertCelciusToFahrenheit( double celcius ) {
>    return 9.0/5.0 * celcius + 32.0;
> }
>
> and produce this code:
>
> public double convertCelciusToFahrenheit( double celcius ) {
>    if( !(celcius > -273.15 ) ) {
>       throw new Error( "precondition failed" );
>    }
>    return 9.0/5.0 * celcius + 32.0;
> }

Just out of interest, could this be done easily with XDoclet?  What do the 
developers think would be the best way of implementing it?  From a 
developer point of view, if I define a class called ExampleClass, 
then XDoclet should generate a new version of ExampleClass with the @pre, 
@post and @invariant code in there.

Clients using ExampleClass shouldn't be aware or care if it has contract 
enforcement code in there.

Cheers,
David

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to