- you call python makeJavaApi.py from the command line which lives in ccpn/python/memops/scripts_v2
- This then uses XmlModelIo.readModel() to read the pure ccpn metamodel which returns the root meta-package as its result
- a thing called the ModelPortal gets constructed from the meta-model. (This seems to provide functions that access the meta-model in particular ways, examples include for example leafPackagesByImport - leaf packages sorted by import (imported before importing), dataTypesByInheritance - data types sorted by inheritance (supertype before subtype), dataObjTypesAlphabetic - data types sorted alphabetically by name etc...)
- JavaFileModelAdapt.processModel(modelPortal) processes the model-portal (and its owned meta-model) to adapt it to the idiosyncrasies of the requirements of the java language
- the class method JavaFileApiGen.writeApi gets called with the model-portal as its first parameter and information in the other parameters about where to store the model the version.
- finally inside JavaFileApiGen.writeApi we do some more setup create a JavaFileApiGen object and then call processModel() on it this then calls a general meta-model traverser which is in the class ModelTraverse.processModel
- now comes the interesting bit! This then causes a series of callbacks on the JavaFileApiGen class to be called. Using the following hack I think I can work out most of them...
grep def ../metamodel/ModelTraverse_py_2_1.py | tr '(' ' ' | awk '{print $2}' - this then visits the following list of apparently interesting methods
- processBranchPackage
- initLeafPackage
- processLeafPackage
- endLeafPackage
- processDataType
- processConstant
- processException
- initClass
- processClass
- endClass
- initDataObjType
- processDataObjType
- endDataObjType
- processAttribute
- processRole
- initOperation
- processOperation
- endOperation
- processParameter
Sunday, March 23, 2008
How do ccpn data models get written
Here are my brief results from digging around the ccpn data-model production software (v2.1) from source forge to see how data-model writing gets carried out (note these are my random doodlings and may not represents how it really works i.e. ymmv)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment