Re: [mdr-users] java source code to MDE

Richard Ciglansky <[email protected]> Tue, 17 Jan 2006 09:42:33 +0100
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
[email protected] wrote:

> Hello everybody,
>
> I have the following classes:
>
> class Clazz{
> ListallAttribute;
> ListallMethod;
> ...
> }
>
> class Attribute{
> private String name;
> private String type;
> ...
> }
>
> class Method{
> private String returnType;
> private String name;
> private List allParam;
> ...
> }
>
> class Param{
> private String name;
> private String type;
> ...
> }
>
> How to do to export instances of Clazz to MDR ?

I'm not quite following, but I would say, that expected way of creating 
a tool which puts Java code into MDR is :

1.) create metamodel of Java language, go to the complexity you need ( 
actually XMI of metamodel )
    This step can be done in various way :
       a.) use Java metamodel already present in Netbeans, it is quite 
complex and covers "almost all features" of current Java.
       b.) find some other metamodel anywhere
       c.) create a metamodel of your own : create an UML model, then 
use uml2mof tool to convert it to metamodel

2.) import "Java metamodel XMI" into MDR repository, generate Java 
interfaces for it

    2.5 ) optional : customize metamodel by implementing "derived" MOF 
associations, or "additional" interface methods in metamodel

3.) write a tool which
        a.) parses java code from *.java files ( or loads informations 
from *.class files )
        b.) puts this information into Java metamodel you are using ( 
from the step 1. ) by "calling/using interfaces/methods" created in step 2.)

4.) write "read-only" tool doing something usefull with the MDR 
repository loaded with date in step 3 : reporting structures/statistics 
of Java code, viewing Java code in some beter way ( call graphs, 
inheritance structures, ... )

5.) if desired : write tool modifying Java code in MDR using interfaces 
from step 2.) => also "read-only tool" for generating of Java code from 
MDR repository would be needed to have changes reflected in Java programs

Classes you defined seems to be actually MOF meta-classes for Java 
langauge which could be automatically generated from Java metamodel.


Richard

>
> Thanks.
>
>
>
> ----------------------------------------------------------------
> ADSL Illimité jusqu'à 20 Mo à 14,90 EUR / mois
> Battez tous les records de vitesse !
> http://decouvrir.neuf.fr <http://decouvrir.neuf.fr/>