+1 to:

freeze():
for all child in children:
   child.freeze()

Cheers,
Chris

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: [email protected]
WWW:  http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






-----Original Message-----
From: Martin Desruisseaux <[email protected]>
Organization: Geomatys
Reply-To: "[email protected]" <[email protected]>
Date: Tuesday, April 23, 2013 2:38 AM
To: Apache SIS <[email protected]>
Subject: Would like opinion about unmodifiable metadata

>Hello all
>
>We often need to build a metadata object, then declare it unmodifiable
>in order to allow the same metadata to be safely shared by many objects.
>For example one may create the following ResponsibleParty for their
>organization:
>
>DefaultResponsibleParty myOrganization = new DefaultResponsibleParty();
>myOrganization.setOrganisationName("My organization");
>myOrganization.setContactInfo(...etc...);
>
>then share the same ResponsiblyParty by many object, e.g. all citations
>toward data or documents produced by that organization. This is
>currently done by invoking the "freeze()" method on the metadata object.
>
>The question is about what should be the behaviour toward child elements
>of the metadata one is freezing. In current implementation, when
>freezing a metadata, we clone all children and freeze those clones. The
>original child objects are left unchanged, which I though would avoid
>unexpected freezing if someone has keep reference to the children
>elsewhere. However when looking back to our experience, I don't think we
>have meet a case where this was useful. So the question is: should we
>change the behaviour and freeze all children directly, without cloning
>them? This would simplify a little bit the code but actually not that
>much.
>
>     Martin
>

Reply via email to