On Wed, 16 Jan 2019 at 17:16, Loïc Pagès <loic.pages@inra.fr> wrote:
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 ?
Maybe #become: ... https://gbracha.blogspot.com/2009/07/miracle-of-become.html but it might be a misuse for your purpose. The following book will provide some good insights... https://www.amazon.com/Design-Patterns-Smalltalk-Companion/dp/0201184621 cheers -ben