Experimental generation of code and documentation from UML

--- Update July 2015: Note that updated openEHR specifications are now available at https://github.com/openEHR/specifications-RM/tree/master/computable/UML, https://github.com/openEHR/specifications-AM/tree/master/computable/UML and browsable links like via http://openehr.org/releases/trunk/UML/ ---

This page is in alpha stage. If it comes closer to beta it will be noted on the openEHR developer mailing list...

EMF is a (meta)modeling framework in Eclipse. UML version 1+ or 2+ are some of the possible meta models. The openEHR RM and AM specifications are available as UML (Magic Draw) and also (partly) as XML Schemas. This wikipage is a intended for people that arw interested in getting the openEHR specification models as input into the EMF framework and then to generate artifacts such as code and documentation as output from the EMF framework.

Experiment description 

An initial experiment was conducted running Eclipse 3.3 on Windows XP.

  1. Get a machine readable version of the openEHR model specifications in UML/XMI-format
  2. Open the UML file in an EMF-enabled Eclipse setup.
  3. Inspect and edit the model if needed. If errors or differences in semantics compared to the PDF-specifications are found, then supply feedback to openEHR (TODO: Add link to JIRA-enry for "computable" spec?) Any EMF-based editing plugin for Eclipse should work. The errors and TODO-items found are listed at the end of this page.
  4. Use, modify or create new (usually template driven) output mechanisms to create code and documentation. There are several ways to go from EMF to Code (see discussion)

Suggested automated (or semiautomated) outputs to develop:

  • Java UPPER_CASE and/or CamelCase class implementation stubs possibly extended by...
    • Annotations for DBC frameworks (rules should be extracted from XMI file)
    • Annotations for serializing frameworks for XML and JSON (and possibly DADL if somebody feels a pressing need for it (smile) )
    • Conversion code between mutable and immutable versions of java implementations
  • JSON Schemas for AM and RM
  • Python stubs
  • C# stubs
  • Ruby stubs
  • Class documentation segments in FM (FrameMaker) format or something that FM can import as long as the specs are written using that tool instead of an open source alternative.
  • Model documentation in other formats (HTML, PDF etc)
  • ...

Errors and TODO-items

V 1.0.1 Alpha 0.02

DONE: (Please not that these "Alpha 0.02" changes  are not uploaded to this site yet)

  • rm.composition.content.entry.INSTRUCTION: Removed double generalization/inheritance to ENTRY
  • rm.composition.content.entry. EVALUATION: Removed double generalization/inheritance to ENTRY
  • rm.data_types.time_specification.DV_TIME_SPECIFICATION: Made it abstract
  • rm.data_structures.representation.ITEM: Added generalization/inheritance to LOCATABLE

TODO:

QUESITONS

  • DV_TIME_SPECIFICATION: Should the children of this class really repeat the method definitions instead of inheriting? Is that because the methods probably will need to be implemented differently and only share signatures?

Additions to prepare audience for V 1.0.1++ (Upcoming versions)

  • Add comment: PARTICIPATION will probably inhertit from LOCATABLE...