Home » Modeling » Papyrus » How to get meta-model of UML design model
| | |
Re: How to get meta-model of UML design model [message #517464 is a reply to message #517454] |
Sun, 28 February 2010 06:56 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------020800060507070905010602
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Yu-Hsin,
There is no reasonable XML Schema for the UML2 serialization; XML schema
doesn't support multiple inheritance yet the UML2 model relies heavily
on it. UML2 and the diagrams themselves, i.e., the Notation model, both
use XMI serialization which is driven directly from their respective
Ecore models. I can't imagine how you would get any value from trying
to process the XML directly. It's still not even clear what exactly
you're trying to do. Likely you should be extending UML using profiles
and should look at the documentation here:
<http://wiki.eclipse.org/index.php/MDT-UML2>
http://wiki.eclipse.org/index.php/MDT-UML2
Yu-Hsin Lin wrote:
> Thanks for your reply :)
> Sorry, what I described above is too complicated and vague.
> Actually, I just wanna to get the XML schema of Papyrus.
> Since I'm a newbie to Eclipse and Papyrus, I have no idea to find it.
>
> When I draw UML diagrams on Papyrus, it will generate XML files after
> saving it.
> And what I want is to get the rules how UML metamodels transform into
> XML format.
> Where can I get this information?
>
> Thanks in advance!
> Yu-Hsin
--------------020800060507070905010602
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Yu-Hsin,<br>
<br>
There is no reasonable XML Schema for the UML2 serialization; XML
schema doesn't support multiple inheritance yet the UML2 model relies
heavily on it. UML2 and the diagrams themselves, i.e., the Notation
model, both use XMI serialization which is driven directly from their
respective Ecore models. I can't imagine how you would get any value
from trying to process the XML directly. It's still not even clear
what exactly you're trying to do. Likely you should be extending UML
using profiles and should look at the documentation here:<a
href="http://wiki.eclipse.org/index.php/MDT-UML2"><br>
</a>
<blockquote><a href="http://wiki.eclipse.org/index.php/MDT-UML2">http://wiki.eclipse.org/index.php/MDT-UML2</a><br>
</blockquote>
<br>
<br>
Yu-Hsin Lin wrote:
<blockquote cite="mid:hmda41$3rl$1@build.eclipse.org" type="cite">Thanks
for your reply :) <br>
Sorry, what I described above is too complicated and vague.
<br>
Actually, I just wanna to get the XML schema of Papyrus.
<br>
Since I'm a newbie to Eclipse and Papyrus, I have no idea to find it.
<br>
<br>
When I draw UML diagrams on Papyrus, it will generate XML files after
saving it.
<br>
And what I want is to get the rules how UML metamodels transform into
XML format.
<br>
Where can I get this information?
<br>
<br>
Thanks in advance!
<br>
Yu-Hsin
<br>
</blockquote>
</body>
</html>
--------------020800060507070905010602--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | | |
Re: How to get meta-model of UML design model [message #517578 is a reply to message #517541] |
Mon, 01 March 2010 11:50 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Yu-Hsin,
Comments below.
Yu-Hsin Lin wrote:
> Hi,
>
> Please allow me to take a simple example to descibe my problem.
>
> If I draw a class called "MyClass" on Papyrus, then the content of
> .uml file should be:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Model xmi:version="2.1" xmlns:xmi="..." xmlns:ecore="..."
> xmlns:uml="..." xmi:id="..." name="UMLModel">
> <packageImport xmi:id="...">
> <importedPackage xmi:type="uml:Model" href="..."/>
> </packageImport>
> <packagedElement xmi:type="uml:Class" xmi:id="..." name="MyClass"/>
> <profileApplication xmi:id="...">
> <eAnnotations xmi:id="..." source="...">
> <references xmi:type="ecore:EPackage" href="..."/>
> </eAnnotations>
> <appliedProfile href="..."/>
> </profileApplication>
> </uml:Model>
>
> The basic structure of above xml file is supposed to be as follows:
>
> <packageImport>
> <importedPackage xmi:type="uml:Model">
> </packageImport>
> <packagedElement xmi:type="uml:Class" name="MyClass"/>
> <profileApplication>
> <eAnnotations>
> <references xmi:type="ecore:EPackage" />
> </eAnnotations>
> <appliedProfile />
> </profileApplication>
>
>
> So, I just want to get the rules or definitions that how Papyrus
> translates into XML format when users draw some metamodels on this
> kind of MDT.
> It is certainly a stupid problem :blush:, but has bothered me for a
> long time.
Yes, if you look at the Ecore model for UML (the one whose nsURI matches
the namespace in xmlns:uml="..." ) all is evident there. I.e., you'll
find an EClass called Model; that's the name of the root element.
Model inherits from Package, which inherits from Namespace,
PackageableElement, and TemplateableElement. Namespace has a feature
called packageImport so you'll expect to see elements called
packageImport. Package has a profileApplication feature, so you should
expect that too. All UML Elements extend EModelElement from Ecore
itself, which supports an eAnnotations feature, so you see that as well.
So you see that despite Vlad nonsense commentary about the impossibility
to determine the serialization rules, they're very simply defined by the
(meta)model of UML itself, i.e., by the Ecore model of UML. Note that
Ecore is isomorphic to the OMG's EMOF model; Ecore predates EMOF. At
the root, the name of the EClass is used, and below that, all element
and attribute names correspond to feature names within the class of the
instance. This is the basis for any XMI serialization, so if you want
to understand the rules, look closely at the OMG's XMI specification
which defines how any instance of an EMOF model is serialized. We'll
wait patiently for someone like Vlad to come up with a smarter way,
i.e., to reinvent XMI and to convince the OMG that his solution is
superior to the established standard. However, you have to wonder,
given the fact that he's reusing UML and EMF in Omondo and hence that
he's relying on the same mechanism as Papyrus for serialization, why he
spouts the nonsense that he does. No doubt he has little better to do.
> Thanks in advance!
> Yu-Hsin
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | |
Re: How to get meta-model of UML design model [message #517767 is a reply to message #517733] |
Mon, 01 March 2010 23:42 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Vlad,
Comments below.
Vlad Varnica wrote:
> This is amazing that Ed try to explain us that EMF is the standard and
> not UML 2 !!
I'm explaining that XMI, EMOF, and UML are OMG standards. EMF
implements EMOF with Ecore, that is, EMOF and Ecore are isomorphic. As
such, Ecore can be serialized to EMOF and Ecore can be deserialized from
EMOF.
> It seems to me that the OMG has an UML 2.2 specification
Not only does the OMG have a UML specification, it also has an EMOF
specification and an XMI specification. You seem to overlook both of
these things on a regular basis, as if UML itself were the center of the
universe.
> and I don't see any EMF specification at the OMG !!
EMF provides an Eclipse-hosted, Java-based implementation of the OMG's
EMOF and XMI standards. The Eclipse UML2 model, based on EMF, provides
an Eclipse-hosted, Java-based implementation of the OMG's UML 2.x
standard. The Omondo product, as well as IBM's Rational products (just
to mention two of the technologies founded on this stack) each rely
heavily on the EMF, so if the EMF stack is rubbish, then presumably all
that's built upon the EMF stack is also rubbish.
>
> Did I miss something ?
Your medication perhaps?
Just to be clear, EMF implements standards yet it is not itself a
standard. EMOF, XMI, and UML are examples of OMG standards and EMF
helps implement them in Java at Eclipse.
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | | | |
Re: How to get meta-model of UML design model [message #517932 is a reply to message #517872] |
Tue, 02 March 2010 14:47 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Yu-Hsin,
Comments below.
Yu-Hsin Lin wrote:
> Dear Ed and Vlad,
>
> It's really kind of you two :) I have learned a lot from your replies!
>
> I still have some problems:
> I have read the XMI spec.(version 2.1) and have got rules in EBNF
> notation in section 5: XML Schema Production of this document. (We can
> download from the OMG's site: http://www.omg.org/spec/XMI/2.1/PDF/)
> It describes quite clearly and is easy to understand.
> But when I put the rules into .uml files
What does that mean "put the rules into .uml files"?
> which are generated by Papyrus(take above .uml file for example),
> tags' names of rules defined by XMI spec. are different from .uml files.
What's an example of this?
> So I read the MOF spec. (We can also download from
> http://www.omg.org/spec/CWM/1.1/PDF/) and tried to get the information
> about Ecore/EMOF model. However, I could not get it :(
What specifically don't you get?
> Do I still have any misunderstanding?
I suppose so, but I already spelled out how the Ecore model for UML
specifies the tag names used in the serialization. Did that make sense?
>
> Yu-Hsin
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Re: How to get meta-model of UML design model [message #598638 is a reply to message #517733] |
Mon, 01 March 2010 23:42 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Vlad,
Comments below.
Vlad Varnica wrote:
> This is amazing that Ed try to explain us that EMF is the standard and
> not UML 2 !!
I'm explaining that XMI, EMOF, and UML are OMG standards. EMF
implements EMOF with Ecore, that is, EMOF and Ecore are isomorphic. As
such, Ecore can be serialized to EMOF and Ecore can be deserialized from
EMOF.
> It seems to me that the OMG has an UML 2.2 specification
Not only does the OMG have a UML specification, it also has an EMOF
specification and an XMI specification. You seem to overlook both of
these things on a regular basis, as if UML itself were the center of the
universe.
> and I don't see any EMF specification at the OMG !!
EMF provides an Eclipse-hosted, Java-based implementation of the OMG's
EMOF and XMI standards. The Eclipse UML2 model, based on EMF, provides
an Eclipse-hosted, Java-based implementation of the OMG's UML 2.x
standard. The Omondo product, as well as IBM's Rational products (just
to mention two of the technologies founded on this stack) each rely
heavily on the EMF, so if the EMF stack is rubbish, then presumably all
that's built upon the EMF stack is also rubbish.
>
> Did I miss something ?
Your medication perhaps?
Just to be clear, EMF implements standards yet it is not itself a
standard. EMOF, XMI, and UML are examples of OMG standards and EMF
helps implement them in Java at Eclipse.
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Re: How to get meta-model of UML design model [message #598652 is a reply to message #598649] |
Tue, 02 March 2010 11:50 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Vlad,
Comments below.
Vlad Varnica wrote:
> I agree that EMF helps java implementation of UML but if you use EMF
> you get your jave code full of tags.
Tags?
> If you refactor your code then you loose your model information etc...
That relates to this discussion topic how?
> It is not really possible to complete your project without sooner or
> later having to refactor your code, so ....
This has not proven to be a fact for most of the projects upon which
I've worked.
> Did you look at the latest Rational EMF java integration ?
> J:
> http://www.tutorial-omondo.com/RSA7_versus_EclipseUML/no_nee d_for_tag_in_code.html
>
No.
>
> This is exactly what should not been done because model information
> should saved as UML metamodel and not as EMF tags.
These are not EMF tags, they are Rational's choice of tags that have
absolutely nothing to do with EMF.
> On technological point of view it is certainly the same but on
> usability point of view using EMF tags in the code is a disastrous
> decision !!
You might want to let all of IBM's customers know so that can they
switch from Rational to Omondo.
In any case, nothing you say in this note is related to the thread
itself. Not only that, it's not even related to EMF. You seem to go
off the deep end a lot.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | |
Re: How to get meta-model of UML design model [message #598674 is a reply to message #598662] |
Tue, 02 March 2010 14:47 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Yu-Hsin,
Comments below.
Yu-Hsin Lin wrote:
> Dear Ed and Vlad,
>
> It's really kind of you two :) I have learned a lot from your replies!
>
> I still have some problems:
> I have read the XMI spec.(version 2.1) and have got rules in EBNF
> notation in section 5: XML Schema Production of this document. (We can
> download from the OMG's site: http://www.omg.org/spec/XMI/2.1/PDF/)
> It describes quite clearly and is easy to understand.
> But when I put the rules into .uml files
What does that mean "put the rules into .uml files"?
> which are generated by Papyrus(take above .uml file for example),
> tags' names of rules defined by XMI spec. are different from .uml files.
What's an example of this?
> So I read the MOF spec. (We can also download from
> http://www.omg.org/spec/CWM/1.1/PDF/) and tried to get the information
> about Ecore/EMOF model. However, I could not get it :(
What specifically don't you get?
> Do I still have any misunderstanding?
I suppose so, but I already spelled out how the Ecore model for UML
specifies the tag names used in the serialization. Did that make sense?
>
> Yu-Hsin
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Thu Sep 26 20:43:59 GMT 2024
Powered by FUDForum. Page generated in 0.07335 seconds
|