From: hbien@jhu.edu (Harold Bien)
Subject: TECH: Growing Objects
Date: Tue, 09 Jan 1996 16:35:01 +0000 (GMT)
Organization: HCF - Johns Hopkins University, Baltimore, Maryland, USA


From: hbien@jhu.edu (Harold Bien)

     In trying to create a simulation of cells which develop over
time, I have a parent object which owns several children of type
'cell' through a doubly linked-list implementation.

     After a while, the cell "matures" and becomes a different
'object.'  The question posed is this: What is the most
object-oriented approach to handling a list of objects which
metamorphoses?

     Currently, I have two possible options envisioned:

	1) Have a status variable upon which the behavior (methods) of one 
	   (computer) object is based

	2) Have different (computer) objects represent different stages 
	   of the cell and notify the parent object when it metamorphoses.

    I would prefer approach 2 because it is more flexible and
"cleaner."  However, to implement 2 would require that the parent
object delete the old child object from its list and add the new child
object.  However, not only would this increase the inter-class
coupling but also "dirty" the approach .

    Any suggestions as to possible implementations would be
appreciated (including ones which I have not listed above).
    As I'm also cross-posting this to several other newsgroups, please
reply either in comp.simulation or via e-mail to hbien@jhu.edu.

	Thanks in advance for any information which you may offer.


