On 8 Jun 2024, at 09:39, Brother Bill <brother...@gmail.com> wrote:
Created a toy program where BIRD has a name, can speak and fly.Other than manually raising an exception, is there a way to have PENGUIN not be able to fly, either at compile-time or run-time.
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/3b871ec3-b0ba-4e9c-89d2-8deadbd539fan%40googlegroups.com.
<penguins_cant_fly.zip>
Procedure fly in BIRD has a precondition is_flight_enabled, using a boolean-valued function with result True (if flight should be enabled by default – design decision that can be made one way or the other – can also be deferred to avoid taking a stand, then each class is responsible for its own choice).
In PENGUIN, redefine or effect that function so that it returns False.
With best regards,
-- Bertrand Meyer
Latest book: Handbook of Requirements and Business Analysis, Springer, 2022
A treatise and textbook on requirements, see https://se.ethz.ch/requirements
From: eiffel...@googlegroups.com <eiffel...@googlegroups.com> On Behalf Of Brother Bill
Sent: Saturday, 8 June, 2024 1:39
To: Eiffel Users <eiffel...@googlegroups.com>
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/3b871ec3-b0ba-4e9c-89d2-8deadbd539fan%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/11b69917-c151-4870-8990-9ee4ce50cd96n%40googlegroups.com.
For the potential amusement of some, an
ontology-oriented discussion of this exact problem.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/a5351e8f-1bef-4e5f-bead-c79abe245b66%40gmail.com.
Just a moment: penguins CAN fly.
But they fly underwater.
I've just remembered a documentary about South Pole.
And what I've seen is NOT "swimming": it's really "flying"
underwater.
Davide
For the potential amusement of some, an ontology-oriented discussion of this exact problem.
On 08/06/2024 00:26, Ulrich Windl wrote:
Hi! The actual problem is that your BIRD is wrong if a PENGUIN is a bird. Maybe has_wings (being constantly true) would be the better property. Also the can_speak seems problematic to me. That shows the essence of the problem IMHO: If you start with poor modeling, you'll run into problems sooner or later. While developing you'd typically adjust the model to fix the problems. Ulrich 08.06.2024 02:39:25 Brother Bill <brother...@gmail.com>:Created a toy program where BIRD has a name, can speak and fly. Other than manually raising an exception, is there a way to have PENGUIN not be able to fly, either at compile-time or run-time. --
-- ing. Davide Grandi linkedin : http://linkedin.com/in/davidegrandi
You may find the book 'Basic Formal Ontology' instructive. It's
about ontology building not information modelling. I have known
the main author (Prof Barry Smith) for many years, and his way of
thinking completely changed mine (and made me realise that almost
the entire canon of 'information modelling' is in worse darkness
than Plato's cave.)
https://www.amazon.com/Building-Ontologies-Basic-Formal-Ontology/dp/0262527812
thomas
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/d0d956bc-e616-428b-87dc-851109e25f88n%40googlegroups.com.
At zero g, weightless, flying should be
like swimming.
Asimov, maybe, wrote something about it.
Davide
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/22b8fb15-88c3-4135-b225-34a41c02a3af%40email.it.