You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by "Martin Desruisseaux (JIRA)" <ji...@apache.org> on 2017/11/17 14:22:00 UTC

[jira] [Closed] (SIS-355) Provide a "deep copy" operation on ISO 19115 metadata

     [ https://issues.apache.org/jira/browse/SIS-355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Desruisseaux closed SIS-355.
-----------------------------------

> Provide a "deep copy" operation on ISO 19115 metadata
> -----------------------------------------------------
>
>                 Key: SIS-355
>                 URL: https://issues.apache.org/jira/browse/SIS-355
>             Project: Spatial Information Systems
>          Issue Type: Task
>          Components: Metadata
>    Affects Versions: 0.3, 0.4, 0.5, 0.6, 0.7
>            Reporter: Martin Desruisseaux
>            Assignee: Martin Desruisseaux
>            Priority: Minor
>             Fix For: 0.8
>
>
> In Apache SIS, all implementation classes of ISO 19115 metadata types have a shallow copy constructor. However there is nothing for performing a deep copy (the {{clone()}} method is not for this purpose). While deep copy should be avoided, it is sometime useful for example when using an existing metadata as a template.
> h3. Better alternative
> Note that the {{ModifiableMetadata.unmodifiable()}} method provides a better way to use a metadata as a template, as it returns a snapshot and allows the caller to continue to modify the original metadata object and create new snapshots. This approach allows sharing the children that have the same content, thus reducing memory usage. In comparison, deep copy operations unconditionally duplicate everything, no matter if it was needed or not. Nevertheless deep copies are still sometime useful, for example when we do not have the original {{ModifiableMetadata}} instance anymore.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)