home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / eiffel / 1446 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.7 KB  |  42 lines

  1. Newsgroups: comp.lang.eiffel
  2. Path: sparky!uunet!walter!geoff
  3. From: geoff@flash.bellcore.com (Geoffrey Clemm)
  4. Subject: Re: creation
  5. In-Reply-To: mbk@lyapunov.ucsd.edu's message of 20 Jan 1993 21:33:08 GMT
  6. Message-ID: <GEOFF.93Jan21212720@wodehouse.flash.bellcore.com>
  7. Sender: news@walter.bellcore.com
  8. Nntp-Posting-Host: wodehouse.bellcore.com
  9. Organization: Bellcore
  10. References: <175@eiffel.eiffel.com> <1jkgekINNa4i@network.ucsd.edu>
  11. Date: 21 Jan 93 21:27:20
  12. Lines: 28
  13.  
  14. In article <1jkgekINNa4i@network.ucsd.edu> mbk@lyapunov.ucsd.edu (Matt Kennel) writes:
  15.    ram@eiffel.com (Raphael Manfredi) writes:
  16.    : I think there are some situations where a creation procedure may require a
  17.    : postcondition, completing the assertions coming from the invariant. For
  18.    : instance, assume you are creating an object representing a Finite State
  19.    : Automaton (FSA). You may want to have two or three creation procedures
  20.    : to make sure the FSA is put in one of its "begining" states. The postcondition
  21.    : would express that the FSA is indeed in the correct state.
  22.  
  23.    I have a basic question here.
  24.  
  25.    How are postconditions useful?  It seems that they express little
  26.    beyond the correct functioning of a class feature.
  27.  
  28. I thought Raphael was very clear in his answer.  If you have several creation
  29. procedures, each of which initialize the FSA into a *specific* *distinct*
  30. state, then you would like to have a post-condition stating the characteristics
  31. of that state.  The post-conditions on each of the creation procedures could
  32. significantly differ, to the extent that the distinct initial states differ.
  33.  
  34. Having an invariant that says you are in one of the legal states is worthless
  35. if you need to be in a specific initial state.
  36.  
  37. Cheers,
  38.  
  39. Geoff
  40. --
  41. geoff@bellcore.com
  42.