Preconditions, postconditions and assertions
Posted: Fri Aug 07, 2009 10:51 am
by johnmunro >> Tue, 21 May 2002 10:07:02 GMT
Does anyone know how likely it is for preconditions, postconditions and assertions to be incorporated into Jade? They are extremely useful coding structures (yes, I learned OOP on Eiffel). I am currently doing assertions myself, by placing the following method on Object:
assert(assertCondition : Boolean);
vars
tmpException : AssertionException;
begin
if not assertCondition then
create tmpException;
tmpException.errorCode := UserException_AssertionFailed;
tmpException.errorItem := "Assertion Failed";
tmpException.continuable := false;
tmpException.resumable := false;
tmpException.extendedErrorText := "Assertion Failed";
tmpException.kind := '0';
raise tmpException;
endif;
end;
which works fine, but without a precondition structure built in, it results in the starts of all my methods being a big list of assertions undivided from the main method body. I assume the epilog is ok to put more assertions in as postconditions...
Having searched the newsgroups I found another thread about preconditions, postconditions and assertions from February 2001, in which Dean implies that they could be added in, which hopefully means it's more likely...
Anyway, that's my new feature suggestion: build preconditions, postconditions and assertions into Jade.
--
John Munro
Synergist Limited - Home of FileVisionT
The Bioscience Innovation Centre
Cowley Road, Cambridge, UK
CB4 0DS
Telephone: +44 (0) 1223 478200
Fax: +44 (0) 1223 477969
Email: john.munro@filevision.com
Web: http://www.filevision.com
The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact Synergist Limited immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. Synergist Limited cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform Synergist Limited.
Does anyone know how likely it is for preconditions, postconditions and assertions to be incorporated into Jade? They are extremely useful coding structures (yes, I learned OOP on Eiffel). I am currently doing assertions myself, by placing the following method on Object:
assert(assertCondition : Boolean);
vars
tmpException : AssertionException;
begin
if not assertCondition then
create tmpException;
tmpException.errorCode := UserException_AssertionFailed;
tmpException.errorItem := "Assertion Failed";
tmpException.continuable := false;
tmpException.resumable := false;
tmpException.extendedErrorText := "Assertion Failed";
tmpException.kind := '0';
raise tmpException;
endif;
end;
which works fine, but without a precondition structure built in, it results in the starts of all my methods being a big list of assertions undivided from the main method body. I assume the epilog is ok to put more assertions in as postconditions...
Having searched the newsgroups I found another thread about preconditions, postconditions and assertions from February 2001, in which Dean implies that they could be added in, which hopefully means it's more likely...
Anyway, that's my new feature suggestion: build preconditions, postconditions and assertions into Jade.
--
John Munro
Synergist Limited - Home of FileVisionT
The Bioscience Innovation Centre
Cowley Road, Cambridge, UK
CB4 0DS
Telephone: +44 (0) 1223 478200
Fax: +44 (0) 1223 477969
Email: john.munro@filevision.com
Web: http://www.filevision.com
The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact Synergist Limited immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. Synergist Limited cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform Synergist Limited.