NAME
UMMF - UML Meta-Model Framework. UML to code generation via XMI. Implements UML 1.5 meta-model. Provides object-oriented Perl interface for processing UML meta-models and models. Imports XMI. Includes XMI, Perl and Java code generation back-ends.
SYNOPSIS
bin/ummf -e Perl someumlmodel.xmi
DESCRIPTION
Also See http://ummf.sourceforge.net and the "examples"
directory in the distribution for more information.
What is UMMF?
UMMF is an open-source implementation of a UML Meta-meta-model, for the purposes of reifying UML meta-model implementations and to provide a platform for building flexible UML transformation tools.
It is written in Perl and provides an almost complete specification of the UML 1.5 meta-model in a human and machine-readable meta-meta-model description language.
The meta-meta-model description is used to generate implementations of the UML meta-model in XMI, Perl and Java and other languages. Thus, one specification of the meta-model can generate meta-model implementations in many programming languages. Once a programming language has been targeted with an exporter, code can be generated for UML meta-models and models.
Why UMMF?
The goal of UMMF is processing of UML models and meta-models in a variety of implementation languages for the purpose of transforming UML models.
UMMF is self-hosting; for example: the Perl UMMF:UML::MetaModel package is generated by bootstrapping from the meta-meta-model. The meta-meta-model is specified with the same specification as the meta-model.
Models can be imported from popular UML editors via XMI 1.0 and 1.2. Meta-models and models can currently exported to XMI 1.2.
Code generated from UML models by UMMF is reflective; models can reflect on their own meta-models. For example, the code exporters generate a __classifier()
method for each Class that will return the meta-model Classifier object for the model object.
Many inexpensive UML editors have inflexible or non-existant code generation tools. Generating code using XSLT on XMI is an adventure into the pain of a W3C-sponsored hell.
UMMF allows you to control how your Model will be translated into code; add your special archtectural or environmental support without relying on third-party proprietary tools!
UMMF can provide a base UML meta-model implementation for other UML tools.
What is the development status of UMMF?
As of 2003/09/31, UMMF is still alpha software; everything and anything may change. But please keep in mind, it's not in my best interest to change it too much, because I rely on it. UMMF is being actively developed and used for generating code for production systems. I (Kurt Stephens) and dedicate significant resources to develop UMMF; I am building large systems in Perl using UML.
If you think that UMMF could be useful for your project or if I can help you get started, please let me know.
What does UMMF do?
UMMF transforms UML models to simplify code generation; for example:
Generate Interfaces for all Classes.
Transform Classes with multiple inheritance to single inheritance using Interfaces.
Resolve AssociationEnd name collisions across Generalizations.
Generate interstitial Associations for AssociationClass' AssocationEnds
Merge ModelElements from multiple XMI documents using Classifiers designated as 'ummf.placeholders'. This functionality is very alpha.
Additional transformations will be developed to support other architectural concerns.
What can UMMF do?
As of 2004/03/30 (v0.20), UMMF can:
Generate Classifier code for UML 1.5 meta-model in Perl and Java, using code templates.
Generate Classifier code for UML 1.5 meta-model for Tangram.
Generate Classifier code for UML 1.5 meta-model from code generated from meta-meta-model.
Generate Classifier code from UML 1.3 - 1.5 meta-model from XMI input.
Import XMI 1.0 and 1.2.
Export XMI 1.2.
Directly read ArgoUML (XMI 1.0), Poseidon 1.x and 2.x (XMI 1.2) .zargo and .zuml files.
Perform various model transformations (as listed above).
Support method bodies in multiple implementation languages, by using
"# UMMF-Lang: Perl"
or"// UMMF-Lang: Java"
comments to delimit different method implementations.Support model reflection in Perl.
Use of
Serializable
for meta-model storage has been implemented and tested.Can export XMI for the UML-1.5 meta-model, using itself as the meta-meta-model.
Try running
"bin/ummf -e XMI UML-1.5"
!!!Preliminary implementation of UML 1.5 "Behavioral Elements::Actions" meta-model package. This functionality is very alpha.
Preliminary implementation of OCL for UML 2.0:
AST Expression Trees This functionality is very alpha.
Support for Tangram, the pure-Perl, orthogonal, object-relational persistence mapping layer. This functionality is out of beta!
What doesn't UMMF do?
As of 2003/09/31:
Does not support model reflection in Java.
Does not correctly propagate UML documentation into template-generated code documentation (embedded POD). This is implemented, but is not working correctly.
What should UMMF do?
Have more documentation. More pod and maybe a Wiki?
Have more examples.
Have more test cases.
Process OCL: An OCL parser and expression model is being built, based on the OCL for UML 2.0 RFP response draft.
Have more exporters: IDL, C++, Objective-C, Scheme, PHP, etc.
Generate code for UML State Machines and other models.
Handle multiple UML meta-model versions. A UML 2.0 meta-model specification file is currently being built.
The things you wish UML editors did for you, like generate Perl or Befunge code the way you like it. Please contribute!
Bootstrap from the meta-meta-model with minimal assumptions.
Where can I get UMMF?
The SourceForge site, http://sourceforge.net/projects/ummf/ or a pre-built version from CPAN. You may want to check the CVS repository for the latests changes; point your browser at http://cvs.sourceforge.net/viewcvs.py/ummf/ummf/1.0/.
What does UMMF need?
As of 2004/03/30, UMMF requires:
Perl 5.6.1 (or later?)
CPAN libnet 1.16 (or later)
CPAN libxml-perl 0.07 (or later)
CPAN Template 2.10 (or later)
CPAN Set::Object 1.05 (or later)
CPAN XML::Writer 0.4 (or later)
CPAN XML::Parser 2.31 (or later)
CPAN XML::DOM 1.42 (or later)
CPAN Archive::Zip 1.06 (or later) (for .zargo and .zuml file support)
CPAN Scalar::Util 1.13 (or later)
CPAN Devel::StackTrace 1.03 (or later)
CPAN Class::Multimethods 1.70 (or later)
CPAN YAML
Bootstrapping dependencies:
POSIX shell. (bin/sh)
GNU make. (If you're stuck on Windoze, cygwin saves the day :)
How do I use UMMF?
See "perldoc bin/ummf.pl"
See other POD or see HTML documentation built in doc/html/index.html. (On-line version doc/html/index.html)
See "ummf/example/ex*"
How do I build (bootstrap) UMMF?
- 1. Make sure Perl is in your PATH.
- 2. tar -zxvf ummf-*.tar.gz
- 3. cd ummf-*
- 4. If you do not have all the prerequise modules already installed:
-
perl sbin/ummf_install.pl
- 5. make bootstrap
-
This will build the UML meta-model classes in gen/perl.
- 6. make
-
This will build the bin, gen/perl and doc/html directories.
What mailing lists are available for UMMF?
UMMF-announce@lists.sourceforge.net
Low-volume list for new releases and other announcements.
UMMF-user@lists.sourceforge.net
List for UMMF user issues, problems and support (may become high-volume)
UMMF-devl@lists.sourceforge.net
Low-volume list for UMMF developers only.
UMMF-cvs@lists.sourceforge.net
CVS notifications (may become high-volume)
Not So Frequently Asked Questions
What is the relationship of this to MOF?
UMMF does not implement MOF, yet. IMHO, MOF is simply a subset of UML "Foundation" meta-model Package with all the class names prefixed with "Meta" and plenty of CORBA IDL to keep OMG happy. Maybe it exists because a lot of work was invested in hand-coded UML meta-model implementations. :) Actually, there significant differences between MOF and UML, but for purposes of handing UML models, specifying the UML meta-model as UML, as it is documented in the OMG specifications, instead of as a MOF model, works quite well.
If we need CORBA IDLs, then UMMF could have an IDL exporter that could generate IDL for *all* the M* layers. Actually, a UMMF IDL exporter should generate the exact same IDLs from a MOF specification as the ones published by OMG, which look, to me, to be generated from *something*, just like the XMI DTDs.
To select a subset of the UML meta-model to represent MOF, the meta-model specification in UMMF could be annotated with C preprocessor #ifdef and #define to select the appropriate subset as specified in the table on p. xiii of the MOF 1.4 specification.
UMMF uses its UML meta-model description as its own meta-meta-model; the two are interchangable in UMMF since they mostly have the same task in UMMF: represent UML models and transform them; the UML meta-model is just a model in UMMF.
At some point it might make sense to have drop the hard-coded UML meta-model specification I wrote and generate its meta-model directly from analysis of the MOF IDLs published by OMG. Then when OMG publishes new IDL mappings for subsequent versions of the MOF, we all get code for free. But that may not work, since MOF is not UML. Maybe I'm just getting myself confused here. :) Maybe when UML 2.0 makes it's sweeping changes to the UML meta-model, that will make sense.
UMMF is a work in progress, but I think it has the potental to be the thing that generates standard UML meta-model implementions across many languages and environments. Think of it as the "XML DOM" generator for the UML meta-model.
Why isn't UMMF written in Java? or C++? or Cobol?
Perl has
eval().
Perl is better at string processing.
In Perl, you change an object's class at runtime, which makes bootstrapping the M2 layer really easy.
Perl has real closures.
Perl supports multiple inheritance; which supports the UML meta-model use of multiple Generalization parents directly.
Perl is dynamically typed, which allows code to be reused across the M* layers, without resorting to a festering tree of interfaces; (either an object responds to foo() or it just doesn't :)
Perl has mechanisms for trapping and dispatching messages with undefined methods at run-time (via AUTOLOAD).
Because Perl is a floor wax and a dessert topping!
EXPORT
None exported.
ENVIRONMENT VARIABLES
- UMMF_RESOURCE_PATH
-
List of ":"-separated paths to search for UMMF resources. If you are using the compiled CPAN distribution, you must include the
"data"
directory from the distribution in this variable, or you can copy the"data"
directory to the directory named"UMMF"
where"UMMF.pm"
was installed bymake install
. - UMMF_TEMPLATE_PATH
-
List of ":"-separated paths to search for UMMF Exporter templates.
AUTHOR
Kurt Stephens, kstephens@users.sourceforge.net 2003/09/10
SEE ALSO
VERSION
0.25
REVISION
$Revision: 1.14 $
METHODS
resource_path
UMMF->resource_path($type);
Returns a list of directories to search for files of type $type
.
tmp_dir
my $dir = UMMF->tmp_dir;
Returns directory to be used for temporary files.
make_tempfile
my $filename = UMMF->make_tempfile;
Returns a temporary file.