180 likes | 297 Views
The MEMOPS Programming Framework Wayne Boucher, Cambridge http://www.ccpn.ac.uk /. Introduction. CCPN: Collaborative Computing Project for NMR (Nuclear Magnetic Resonance) MEMOPS: MEtaMOdelling Programming System. NMR Software. Problem Heterogeneous collection of developers
E N D
The MEMOPS Programming FrameworkWayne Boucher, Cambridgehttp://www.ccpn.ac.uk/
Introduction CCPN: Collaborative Computing Project for NMR (Nuclear Magnetic Resonance) MEMOPS: MEtaMOdelling Programming System
NMR Software • Problem • Heterogeneous collection of developers • Lots of stand-alone programs • Lots of proprietary data formats • Lots of conversion scripts • Solution • Standards (production to deposition) • Libraries (open, modular, …)
Data Format vs. Model • Data format (how data is stored) • STAR • XML • SQL • Tab-separated ascii • Python pickle file • Data model (what data means) • RCSB (PDB) mmCIF • XML DTD or schemas • SQL schema
NMR Community Consensus • Data model rather than data format • Format independent • Language independent • Science (descriptive) • API to manipulate data model in memory • Creation and manipulation of objects • One for each language • Bookkeeping • I/O modules to load/store data from/to disk • One for each (storage format, language) • Bookkeeping
Application View User GUI Application1 Application2 Application3 API In Memory Representation (Python, Java, C++, C) I/O Data Store (XML, SQL)
Model Driven Architecture • UML: Unified Modelling Language • Abstract representation of semantics • Pictorial • Mapping from UML: to anything • Multi-language • Multi-format • Architecture neutral (e.g. distributed or not) • Power: good and bad • CCPN uses Object Domain as its UML tool • Python as scripting language
Information is stored in the UML data model from which XML schema, SQL schema, Python and Java application program interfaces (APIs) and Documentation are generated automatically Framework Overview PHYSICAL world CCPN framework UML data model Auto-generated XML schema SQL schema Python API Java API Doc
MEMOPS UML • MEMOPS only uses part of UML (logical model) • Roughly equivalent to MOF subset of UML • Influenced by XML • Parent classes (but not all links are parent-child) • Influenced by SQL • Keys • Modular (packages) • Main focus is NMR but entire architecture is independent of NMR
Methodology Summary • MetaModel: classes for defining semantics • E.g. MetaClass, MetaAttribute, MetaRole • Model: instantiation of MetaModel classes • E.g. (Meta)Experiment • API: classes which define semantics • E.g. Experiment • Developer: instantiation of API classes
UML to API • Stage 1: UML to MEMOPS Model • Currently script dependent on UML program • Eventually move to XMI • Stage 2: MEMOPS Model to MEMOPS API • Script independent of UML program • Most CCPN people work independently of UML
MEMOPS MetaModel • Method of describing model semantics • Implemented as Python classes • Could do same in Java, … • Independent of end language • Independent of actual model • Hand coded • Currently around 12 classes, 3000 lines • MetaPackage, MetaClass, MetaAttribute, …
MEMOPS Model • Instantiation of MetaModel • Creation of MetaClass objects, … • Might disappear with introduction of XMI • Auto generated from UML • Currently over 300 classes (2300 metaobjects) • NMR main focus so far • Being worked on: protein production • In future: X-ray, … • Shared packages: Molecule, Coordinates, etc.
MEMOPS API • Classes for developers • Mainly getters and setters • More than just code stubs • Constraints (e.g. cardinality) enforced • Links the hard part • Mostly (> 99%) auto generated from UML • Some helper functions and constraints hand coded • Currently around 270000 lines in Python and 600000 lines in Java
Developer Benefits • Specified data model and API • No I/O code • Concentrate on science, not bookkeeping • Extendible • Application data can be assigned to any object • UML model can be extended (packages) • Notifiers • Register interest when specified attribute changes (class, not object, level) • Undo/Redo (in future)
Current State • API releases • b release of Python API in May 2003 • a release of Java API in December 2003 • C/C++ API next (probably 2005) • Storage formats • XML with Python and Java • SQL with Java in April 2004, Python later • Applications • Conversion scripts for legacy NMR data • Graphical NMR assignment program
Acknowledgements • Department of Biochemistry, University of Cambridge • Rasmus Fogh • Tim Stevens • European Bioinformatics Institute (EBI) • John Ionides • Anne Pajon • Wim Vranken • Funding: BBSRC and EU (NMRQUAL and TEMBLOR) • Website: http://www.ccpn.ac.uk