You are here: Home V2 Software Software More ... Developer Notes Legacy Notes 4 Sep 06 - Moving to new Implementation

4 Sep 06 - Moving to new Implementation

Describing changes in moving from branch4 to new implementation

New Implementation Package

We are now moving over to the new Implementation package. A number of changes, notably the introduction of the TopObject classes have been made before this in branches 3 and 4. See 16 Aug 2006 - changes to packages.


NB These  changes only affect the trunk. They will not break your code for a while yet.


The Implementation package looks like this, with some changes still to be completed:



Green broadheaded arows are active only in file-based implementations, blue broadheaded arrows in database implementations.

All classes outside the Implementation package subclass either AbstractTopObject (for TopObjects) or MemopsDataObject (all other classes). All TopObjects are children of MemopsRoot and have a 'current' link (e.g. 'currentNmrProject', 'currentChemComp') that is one-way and 0..1. All packages have exactly one TopObject - all other classes in the package are (grand)children of that TopObject.

Model Changes

The following changes have been made relative to branch4:

  • Changed ApplicationData to a DataObjType
  • Changed Url to a DataObjType
  • Moved NmrReferenceStore, NmrConstraintStore and MolStructure to NmrReference, NmrConstraint, and MolStructure, respectively.
  • Moved  AccessObject to the AccessControl package, and made it a child of AccessControlStore. NB. This will require all other packages (except Implementation) to import AccessControl. Should be done automatically.
  • NmrReferenceStore.molType and  NmrReferenceStore.ccpCode are removed.
    The key to the class is (new attribute)
  • ChemCompNmrRef.sourceName is removed. The key to the class is now (molType,ccpCode)
  • Added NmrConstraintStore.nmrProject link, 1..1 and frozen, two-way, * in rverse direction.
  • Changed MolStructure parent from MolSystem to MemopsRoot, keeping the 1..1 and frozen link to MolSYstem.
  • Removed ChemCompHead, moving all links from ChemCompHead to ChemComp
  • Removed ChemCompCoordHead, moving all links from ChemCompCoordHead to ChemCompCoord.

Proposed Model Changes

The following changes should be considered:

  • Change NmrConstraintStore key from serial to (nmrProject,name)
  • Change MolStructure key from serial to (molSystem,name)
  • Change AnalysisProject key from serial to (nmrProject, name)

Open Questions

  • Storing file pointers:
    The Url class must be removed from the Implementation package like everything else containing actual data. This means we must find a new way of handling file pointers. Currently they ar used in Analysis.StoredContour, Nmr.DataSource, Annotation.Annotation, but there will surely be more later. Some possibilities, simplest first:
    • Have a Url DataObjType attribute whenever a file pointer is needed. This means that e.g. changing a directory requires changing all individual pointers.
    • Keep the Url object to point to directories/repositories, and put it in a new package under general (call it DataStorage)? Use  link to the Url and a local 'path/filename' attribute to indicate the exact location. This allows moving data without changing lots of objects, but is more complex.
    • Add even more complexity - e.g. file name production templates?
    As a temporary solution I am putting an attribute dataLocation:Url in Analysis.StoredContour, Nmr.DataSource, and Annotation.Annotation.
    This replaces the DataSource.dataLocation link, StoredContour.pathString and StoredContour.url, Annotation.pathString and Annotation.url