[Bioperl-l] First commit of Bio::Structure objects
Kris Boulez
Kris.Boulez@algonomics.com
Mon, 19 Nov 2001 09:07:22 +0100
Quoting Ewan Birney (birney@ebi.ac.uk):
>
> Re: objct cycles - the DESTORY route is really hard to get right so I
> would encourage you Kris to go for the "parent object knows about the
> relationships" or (my solution) - punt on making children know about the
> parents, and force any script that wants to know about this to do its own
> bookeeping ...
>
After a weekend of thinking about it, I think I understand the problem
and I agree that the only solution there is now (client needs to call
DESTROY method on object), will not work.
>
> Most scripts probably wont need to go child--> parent as to get to the
> child they must have gone through the parent...
>
Unfortunately I think they do. A typical use case would be "Give me all
the atoms which are less then 5 A away from this atom". Starting from
this list of atoms you would then want to know to which resideu/chain
they belong.
$atom->residue->id
I see two possible solutions for this:
- store the residue/chain info as textual attributes when
creating/modifying the Atom (if we do this why do we need objects and
references)
- use an extra layer on top (as suggested by Chris Mungall), which is
called 'Factory' in Design Patterns-speak (I think).
I'll implement the second one, unless someone starts shouting.
Kris,
--
Kris Boulez Tel: +32-9-241.11.00
AlgoNomics NV Fax: +32-9-241.11.02
Technologiepark 4 email: kris.boulez@algonomics.com
B 9052 Zwijnaarde http://www.algonomics.com/