Uploaded image for project: 'Spatial Information Systems'
  1. Spatial Information Systems
  2. SIS-87

Provide copy constructors in metadata objects

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.3
    • Metadata
    • None

    Description

      Every subclass of ISOMetadata should provide a copy constructor. Problem is that those copy constructors are very tedious to write. The shallowCopy(Object) method working with Java reflection has been created for making that easier. However shallowCopy can not be invoked from the constructor (actually it can, but this is dangerous because shallowCopy invokes in turn overrideable methods before the subclasses have been initialized).

      This task can be subdivided in the following sub-tasks:

      • Write a small program generating most of the copy constructor code automatically.
      • Write a small program generating most of the test code automatically (probably the same program in a modified form).
      • Update all castOrCopy methods to use the new copy constructor.
      • Transform the shallowCopy method into an append method, which may be more useful. The difference would be that new items are added into existing collections instead than overwriting the previous ones.

      Attachments

        Issue Links

          Activity

            People

              desruisseaux Martin Desruisseaux
              desruisseaux Martin Desruisseaux
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: