You are here: Home V2 Software Software More ... Developer Notes Legacy Notes 16 Aug 2006 - new package organisation

16 Aug 2006 - new package organisation

Changes to packages including renaming, introduction of TopObjects, and reorganisation of directories.

Naming recommendations

  • Package names should be singular.
  • For TopObjects that are real objects, it is recommended to use the same name as the package.
  • For TopObjects that are dummy objects the name should be collective. In most cases it is recommmended to add 'Store' to the package name. 'Project' could be used if the contents form a project on  specific theme, rather than a simple subdivision of a field of data. TopObjects with actual meaning should  be named accordingly (Molecule, MolSystem, Database, Taxonomy).
  • It is recommended to use 'name' for the (pseudo)key of dummy TopObjects.

 

New TopObjects and package names

PackageNew nameTopObject
BmrbEntry NmrEntry NmrEntryStore (new)
ChemElement ChemElement ChemElementStore(new)
Citation Citation CitationStore (new)
Method Method MethodStore (new)
Instrument Instrument InstrumentStore (new)
People Affiliation AffiliationStore (new)
RefStereochemistry Stereochemistry StereochemistryStore (new)
Nmr Nmr NmrProject (new)
Analysis Analysis AnalysisProject (new)
NameMapping NameMapping NameMappingStore (new)
Coordinates MolStructure MolStructure (current name: Structure)
NmrConstraints NmrConstraint NmrConstraintStore (current name: NmrConstraintHead)
NmrReference NmrReference NmrReferenceStore (current name: NmrReferenceHead)
ChemComp ChemComp ChemComp (unchanged)
ChemCompCoord ChemCompCoord ChemCompCoord (unchanged)
ChemCompCharge ChemCompCharge ChemCompCharge (unchanged)
ChemCompLabel ChemCompLabel ChemCompLabel (unchanged)
Molecule Molecule
Molecule (unchanged)
MolSystem MolSystem MolSystem (unchanged)
NmrExpPrototype NmrExpPrototype NmrExpPrototype (unchanged)
Implemented in a second phase:
Annotation Annotation
AnnotationStore (new)
Crystallization Crystallization CrystallizationStore (new)
ExpBlueprint ExpBlueprint ExpBlueprintStore (new)
Experiment Experiment ExperimentStore (new)
Holder Holder HolderStore (new)
Location Location LocationStore (new)
Protocol Protocol ProtocolStore (new)
RefSampleComponent RefSampleComponent RefSampleComponentStore (new)
Sample Sample SampleStore (new)
Target Target TargetStore (new)
Taxonomy Taxonomy Taxonomy (new)
AccessControl AccessControl AccessControlStore (new)
Classification (new)
Classification Classification

 

Division of packages


The basic idea is that application specific directories go to the top level, as does memops with the implementation. All scientific data go into a subdirectory under ccp, with the packages grouped by topic. We can not put a directory like 'nmr' at the top level,
because that might cause name clashes with other programs It would look
like this (using old package names):

ccp/
molecule/
ChemComp, ChemCompCharge, ChemCompLabel, ChemCompCoord,
Coordinates, Molecule, MolSystem, ChemElement, RefStereoChemistry

general/
Annotation, Citation, DbRef, Instrument, Method, People, Taxonomy,

lims/
Classification, Crystallization,  ExpBlueprint, Experiment, Holder,
Location, Protocol, RefSampleComponent, Sample, Target,

nmr/
BmrbEntry, Nmr, NmrConstraints, NmrExpPrototype, NmrReference

xray/ or beamline/
New packages produced by bioxdm

ccpnmr/
Analysis, NameMapping

memops/
Implementation, AccessControl

pimslims/
(for application specific only.)

bioxdm/
(for application specific only.)

Code Changes:


As of 24/8/06 branch should be ready for use. My testLoad of old projects works (sort of - it is so slow I have not managed to finish it yet), so code at least works up to a point. Note the following:

Fixes for old code:

  • Backwards compatibility code is in so we can read old XML files. Compatibility will automatically create new TopObjects and load the data files, if any.
  • In all packages with new TopObjects, the 'get', 'findFirst', 'findAll', and 'new' functions that used to be on Project still work. Calling the constructor directly with a project as parent will also work for objects where the real parent is a new TopObject. All these are deprecated and print a warning. They work by going through the 'current' link (see below).
  • The old Project.nmrExperiments link is replaced by the new  NmrProject.experiments link. Note the name change. The 'new', 'get', 'findFirst' and 'findAll' functions ('newNmrExperiment' etc.) are still there, but are deprecated. Project.nmrMeasurementLists works the same way (except there is no 'new' function - the class is abstract).
  • Code, including handcode, that uses getByKey will break when you add the new TopObjects. I have added a fix that will start the search at the currentTopObject and print out a warning.
  • As a more permanent aspect, keys passed to getByKey that start with None will start at the currentTopObject and skip the first navigation step.
  • I am working on removing deprecated features from the Python (not the Java) handcode.

'Future' features:

 

  • All TopObjects, new or otherwise, can be reached from Project with 'new', 'get', 'findFirst', and 'findAll' functions. These will become standard and are recommended.
  • The Project has a modifiable one-way link 'current' to all TopObjects (e.g. currentNmrProject, currentChemComp). These are (re)set every time a new TopObject of the right kind is created or read from file, so that the link always points to the newest (or most recently set) object. This behaviour will continue and the use of 'current' is recommended.

 

Immediate changes 1 - new TopObjects and consequences:

  • The package organisation has changed, as shown above, which means the import statements are changed. I have fixed all the Python import statements I could find, and fixed all occurrences in handcode, whether Python or Java. Any remaining problems have to be handled.
  • Some classes have changed names, as have the links to them. There are no fixes for this, and the code must change. These are:
    NmrConstraintHead -> NmrConstraintStore
    NmrReferenceHead -> NmrReferenceStore
    Structure -> MolStructure.
  • After consultation with Tim, I have added a mandatory, frozen link AnalysisProject.nmrProject. Compatibility takes care of it for existing projects, but you will need to set the link for future Analysis projects.

 

Immediate changes 2 (branch 4) - Classification package:


Various classification clases moved to the new Classification package. The package has a TopObject Classification, with a namingSystem attribute that replaces similar attribtues in the individual classes. The moved classes are children of Classification, have an attribute 'name' as the key and a 'details' attribute. As part of the reorganisation the RiskAssessment package has been removed.

The following classes are transferred to the Classification package:

  • InstrumentType
  • ExperimentType
  • ComponentCategory (renamed SampleComponentCategory)
  • HazardPhrase
    ('clasification' replaced by 'namingSystem', 'code' replaced by'name')
    NB the division in 'MSDS' and 'local' phrases is no longer there - derived links may need updating.
  • HolderType
  • SampleCategory
  • Target.Status (renamed TargetStatus)
  • Target.Scoreboard (rename targetScoreBoard)


Links to the renamed classes are renamed where the link name corresponded to the class name.
NOTE that there is a Target.TargetStatus class. It might be a good idea to rename theis class Target.Status, but this has not been done (yet).

Immediate chagne 3 - DbRef package

Renamed DbName to Database
Renamed DbRef to Entry
Made Entry a child of Database.
Interpackage links to Entry are still named 'dbRef(s)'.