Re: Invariant Issue
Posted: Tue May 13, 2008 12:09 pm
I think that redefining honors the contract of the redefined method. That's why it says "and ensure" ("then ensure" in Eiffel). I'll go check it now, just in case.
Edit: Actually, here: http://docs.eiffel.com/eiffelstudio/gen ... al-10.html
Straight from the horse's mouth.
Even if you actually use the CheapFastContractor class, your contract with the PricySlowContractor still holds. It ensures that the work will be done in exactly 23 days and even if your CheapFastContractor can get it done in 1 day, his implementation of the method should include ChewOnAGrassBlade(22) to honor the contract.
Edit: Actually, here: http://docs.eiffel.com/eiffelstudio/gen ... al-10.html
Straight from the horse's mouth.
Even if you actually use the CheapFastContractor class, your contract with the PricySlowContractor still holds. It ensures that the work will be done in exactly 23 days and even if your CheapFastContractor can get it done in 1 day, his implementation of the method should include ChewOnAGrassBlade(22) to honor the contract.