Objects by Design Forums Here you can view your subscribed threads, work with private messages and edit your profile and preferences Registration is free! Calendar Find other members Frequently Asked Questions Search Home  
Objects by Design Forums : Powered by vBulletin version 2.3.5 Objects by Design Forums > Main Forums > Model Driven Architecture (MDA) > JMI Watch
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
SZ
Administrator

Registered: Apr 2001
Location: New York
Posts: 492

JMI Watch

As the momentum picks up for MDA, we've started to look at the way MDA tools access model information. One way in which this is accomplished is through the use of the Java Metadata Interface - JMI.

JMI supports the currently popular OMG MOF 1.4 specification for storing and accessing metadata in a repository. In the near future, OMG will finalize and publish the MOF 2.0 specification, which corresponds to UML 2.0. The MOF 2.0 specification will require changes to JMI.

This thread will look at how the current generation of MDA and UML tools uses JMI as an interface to modeling information stored in a repository.

If you know of any tools that successfully use JMI, please post to this thread and share this information with our readers.

Report this post to a moderator | IP: Logged

Old Post 02-19-2004 02:24 AM
SZ is offline Click Here to See the Profile for SZ Click here to Send SZ a Private Message Visit SZ's homepage! Find more posts by SZ Add SZ to your buddy list Edit/Delete Message Reply w/Quote
SZ
Administrator

Registered: Apr 2001
Location: New York
Posts: 492

AndroMDA and JMI

Thanks to Matthias Bohlen, founder of the AndroMDA project, for describing how this innovative, open-source MDA tool uses JMI. Matthias provided the following excellent overview:

********************************************

+ AndroMDA is based on Netbeans Metadata Repository (a.k.a. Netbeans MDR, see http://mdr.netbeans.org).
+ MDR is an implementation of the OMG's MetaObject Facility (MOF) standard (see http://www.omg.org/mof).
+ Basically, MDR is able to load arbitrary models based on arbitrary metamodels, provided that you load the metamodel into MDR before you load the model. Example: It can load UML 1.4 models because we load the UML 1.4 metamodel first.
+ MDR uses the MOF-to-Java mapping called JMI (Java Metadata Interface, see http://java.sun.com/products/jmi/index.jsp).
+ MDR reads metamodels as XMI and generates JMI interface bytecode for them.
+ Example: For UML, you get interfaces like UMLClass, Attribute, Operation, Association, etc. If you loaded a database metamodel instead, you would get interfaces like Table, Column, etc.
+ When loading a model, MDR creates an in-memory representation of the model, called an "abstract syntax tree" (AST). Each node in the AST is a Java object that implements one of the generated JMI interfaces.
+ AndroMDA traverses those AST objects, accesses them via their JMI interfaces and shields them with classes that hide the complexity of the UML (or another) metamodel. We call these classes "metamodel facades" or "metafacades" for short.
+ AndroMDA's templates generate source code and access the metafacades to get model information.
+ Example: Let's generate a private field for each attribute of a UML class:

code:
#foreach ($attr in $class.attributes) private ${attr.type.name} ${attr.name}; #end


This would cause an access to a metafacade called UMLClassifierFacade which accesses a JMI interface called UMLClassifier. The method getAttributes() would be called and would return a Collection of AttributeFacades. On each one of those, the methods getType() and getName() would be called. At last, the above Velocity scriptlet would be equivalent to the following pseudo-Java code:

code:
foreach (attr in class.getAttributes()) { generate(" private " + attr.getType().getName() + " " + attr.getName() + ";"); }


That's it! JMI is used to access model information, facades are used to make that access easier and templates are used to make everything visible as text output (typically, the output is source code). This is similar to a three-tier application: JMI is like the database layer, facades are the business object layer, templates are like the GUI.

Report this post to a moderator | IP: Logged

Old Post 02-19-2004 02:29 AM
SZ is offline Click Here to See the Profile for SZ Click here to Send SZ a Private Message Visit SZ's homepage! Find more posts by SZ Add SZ to your buddy list Edit/Delete Message Reply w/Quote
SZ
Administrator

Registered: Apr 2001
Location: New York
Posts: 492

Q&A with Martin Matula

We asked Martin Matula (Sun Microsystems) on the MDR users mailing list (users@mdr.netbeans.org) what the future of JMI is with respect to OMG MOF 2.0 support and he provided the following very useful information:


Q: Are there any plans for the JMI / MDR implementations to be upgraded to support MOF 2.0?

A: Yes, we do plan to actively participate in the JMI 2.0 standard and extend MDR to support it. I expect the JMI 2.0 to start this summer or in September (once MOF 2.0 is finalized).

Q: How will the development of JMI 2.0 take place? How can one monitor or participate in this development?

A: JMI will be developed using the standard JCP process. If your company is a JCP member, you can participate directly or send comments as part of community review. Everybody can send comments once the specification goes to public review.

Q: How will JMI / MDR respond to what is being called "Essential MOF 2.0"?

A: We are still negotiating within the MOF FTF to merge EMOF and CMOF. CMOF in its current state is probably not what we would like to implement. It is too heavy-weight and complex. So if things stay as they are with EMOF and CMOF, most likely we will implement EMOF (possibly with a few extensions). It also depends on which MOF will become the standard MOF used by OMG to express metamodels.

Report this post to a moderator | IP: Logged

Old Post 02-25-2004 12:06 PM
SZ is offline Click Here to See the Profile for SZ Click here to Send SZ a Private Message Visit SZ's homepage! Find more posts by SZ Add SZ to your buddy list Edit/Delete Message Reply w/Quote
mike.lehmann
Junior Member

Registered: Sep 2005
Location:
Posts: 2

A Java repository tool for MOF 2.0

I would like to call your attrention to a repository tool currently developt by a lab at the humboldt university.
http://www.informatik.hu-berlin.de/sam/meta-tools

It provide a repositories based on the CMOF model. It implementes semantics for property subsetting and redefinition. It comprehenses a JMI like mapping but with enhanced features to cover type safety (and avoidance of type casts) by exploiting new Java 5 features like generics and covariant return types.

It features XMI 2.0 import, export; code generation; it transparently allows the integration of user code for derived features and operations.

Report this post to a moderator | IP: Logged

Old Post 09-13-2005 12:41 PM
mike.lehmann is offline Click Here to See the Profile for mike.lehmann Click here to Send mike.lehmann a Private Message Find more posts by mike.lehmann Add mike.lehmann to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 10:18 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 

< Contact Us - Objects by Design >

Powered by: vBulletin Version 2.3.5
Copyright ©2000 - 2017, Jelsoft Enterprises Limited.
Copyright 1999-2005, Objects by Design, Inc.