motz
dilluns, 26. de novembre 2001

"You can't get a fried burger here"

semantic invariants from the pragmatic programmers g

Let's suppose you want to model a very simple transaction, for example, purchasing a hamburger at a fast food establishment. Suppose you have an interface (or abstract class) for "Buying a Burger". The constraints on such a transaction might be expressed as:

Pre-condition to "Buying A Burger": 1) The customer has sufficient money in local currency to purchase a burger. 2) Customer may request options on the burger, any of: cheese, lettuce, or tomato.

Post-condition to "Buying A Burger": 1) Customer will receive a burger with the requested option(s).

Invariant for Burgers: 1) All burgers are made of a beef and kangaroo mixture, and come on a 1.5" diameter roll. 2) All burgers are flame-broiled. 3) All burgers weigh 0.08oz before cooking.

You can't get a fried burger here. If you request a burger with ketchup the supplier is under no obligation to give it to you. If you request a cheese-burger and have the money, you are guaranteed to receive it.

So here we have the pre- and postconditions that define "Buying A Burger". What defines a burger? ...

... Comment

Online for 8549 days
Last update: 3/11/23 17:00
status
Youre not logged in ... Login
menu
... Home
... Tags


search
calendar
novembre 2024
dg.dl.dt.dc.dj.dv.ds.
12
3456789
10111213141516
17181920212223
24252627282930
novembre
recent updates
human "The mind is what
the brain does." (margaret boden) Mind As Machine. A History...
by motzes (3/11/23 17:00)
when industry looks old i
have no idea how i came here, but i still...
by motzes (13/12/22 21:10)
holography explained it has been
20 years since i met nils abramson and heard about...
by motzes (20/2/22 10:22)
digital dilemma as seen in
the year 2000 . Intellectual Property in the Information Age...
by motzes (28/1/22 8:56)
anti colonial connectivity "... it
was after all, the early days of Intelsat, when having...
by motzes (16/8/21 11:20)
old stories revisited ... ...
makes one search again, along the lines given. brought me...
by motzes (6/7/21 14:27)
history writing gerade
im ohr: ein interview mit verkühlter stimme. aufnahmedatum: 2016.
by motzes (30/3/20 15:42)
Nice Thanks for uploading this.
It's an amazing window on the early history of interactive...
by Kayla (1/3/20 15:51)
gibberjabber interesting, die eingefangenen bots
werden in ihrer wortwahl aggressiv.
by motzes (26/10/19 20:41)
rätsel Daniel Schwenter, Philosophischen und
Mathematischen Erquickstunden, Dritter Theil, 1653 | https://archive.org/details/bub_gb_bGM_AAAAcAAJ
by motzes (22/10/19 19:06)

RSS Feed

Made with Antville
Powered by
helma object publisher