Loïc,
Am I correct in assuming you are thinking about a model in which a plant
can have a growing and shrinking list of organs over time and some of
them even have (a growing list of) stages?
I am not an expert on the matter, but to me the stages idea sounds good.
It even allows for historic information (it was a bud from Date1 to
Date2 and since then it is a flower). So transformation would be adding
a new Stage and "terminate" the previous one.
With this you can ask a plant about its current stage on the
reproductive front and maybe other organs as well at any point time.
This may be helpful if you want to build an animation of the plant's
development over time. You can have separate life cycles for each organ.
Does the plant transform in the real world? I mean, is a cherry tree
still a cherry tree, even if it's not blooming any more and carries
fruit instead? So why transform the object in its abstract model?
Just a thought, maybe better ideas show up.
Joachim
Am 16.01.19 um 10:15 schrieb Loïc Pagès:
Dear Pharo users,
I develop software dedicated to the simulation of plant development
and 3D architecture.
In the past, I used Java, but I am very interested in translating code
in Pharo. I appreciated very much the language and the course.
I have a question for you all :
During plant development (ontogeny), new organs appear, that are
gradually tranformed. For example, a bud can make a flower, and then a
fruit.
Organs are conveniently modelled as classes. During the course, I
learned that it was better to make several classes (bud, flower,
fruit) instead of a "fat class" such as "reproductive organ" with many
attributes and stages (bud stage, flower stage, fruit stage). I wonder
how to transform an object into another one, to represent for example
the fact that the flower may become a fruit.
Maybe a naive question ?
Thanks for your lights !
Loïc