Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Introductory question EMF in general
icon5.gif  Introductory question EMF in general [message #492083] Sun, 18 October 2009 09:57 Go to next message
Tom  is currently offline Tom Friend
Messages: 4
Registered: July 2009
Junior Member
Hello everybody,
I've been starting to read about EMF some time ago but the more I read the more confused I get. Some articles say that you can create your own models using EMF and that you can switch between the representations UML, Java and XSD (EMF unifies those). Others say that you can create your own metamodels and use Ecore as the metametamodel.

I would like to know whether my current understand of EMF is correct - and if it isn't what I got wrong.

Basically we can define our own metamodel using annotated java interfaces, xml schema or uml. This can be "transformed" into a .ecore file - the ecore model which represents our metamodel. Moreover there will be a genmodel which can be used to generate for example an eclipse plugin that allows us to create models that are conform to our own metamodel.

What confuses me is that some articles/papers say that we create our own models by using annotated java and so on. Of course a metamodel is a model too but I think a differentiation is not that bad at this point.

Up to now something I got wrong? Concerning the unification of UML, Java and XSD I have another question: I can create my metamodel for example using annotated java. After creating the corresponding .ecore I can create a uml diagram or the xml schema as well and therefore switch between different representations of the meta(!)model?

Thank you very much in advance. I know that these questions are very basic and probably boring for lots of you. Nevertheless I hope someone answers/corrects me.

Best regards,
Tom

[Updated on: Sun, 18 October 2009 09:57]

Report message to a moderator

Re: Introductory question EMF in general [message #492084 is a reply to message #492083] Sun, 18 October 2009 10:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Tom,

Comments below.

Tom wrote:
> Hello everybody,
> I've been starting to read about EMF some time ago but the more I read
> the more confused I get.
It's a floor polish and a dessert topping. :-P
> Some articles say that you can create your own models using EMF and
> that you can switch between the representations UML, Java and XSD (EMF
> unifies those).
Yep.
> Others say that you can create your own metamodels and use Ecore as
> the metametamodel.
Indeed, XSD is a metamodel created with Ecore as the metametamodel.
There's not all that much difference between a model and a metamodel
given they're both models.
>
> I would like to know whether my current understand of EMF is correct -
> and if it isn't what I got wrong.
>
> Basically we can define our own metamodel
You can define your own model. Whether it's a metamodel really depends
on what kind of model you define.
> using annotated java interfaces, xml schema or uml. This can be
> "transformed" into a .ecore file - the ecore model which represents
> our metamodel. Moreover there will be a genmodel which can be used to
> generate for example an eclipse plugin that allows us to create models
> that are conform to our own metamodel.
>
> What confuses me is that some articles/papers say that we create our
> own models by using annotated java and so on. Of course a metamodel is
> a model too but I think a differentiation is not that bad at this point.
Actually I find that more often than not, the word meta leads to
confusion rather than clarifying anything. That appears to be the case
here.
>
> Up to now something I got wrong? Concerning the unification of UML,
> Java and XSD I have another question: I can create my metamodel for
> example using annotated java. After creating the corresponding .ecore
> I can create a uml diagram or the xml schema as well and therefore
> switch between different representations of the meta(!)model?
Yes, you can export to UML, XML Schema, and of course you can generated
Java and you can import from those forms as well.
>
> Thank you very much in advance. I know that these questions are very
> basic and probably boring for lots of you. Nevertheless I hope someone
> answers/corrects me.
As I said, EMF lets you define a model using Ecore, a model for
describing models, and hence Ecore itself is metamodel while the model
you define with Ecore may or may not be a metamodel.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Introductory question EMF in general [message #492086 is a reply to message #492084] Sun, 18 October 2009 12:09 Go to previous messageGo to next message
Tom  is currently offline Tom Friend
Messages: 4
Registered: July 2009
Junior Member
Thanks for your quick answer Ed!

Ed Merks wrote on Sun, 18 October 2009 06:44

It's a floor polish and a dessert topping. Razz


good to know Wink

I'll try to summarize: I can define models using EMF but those models do not necessarily have to be metamodels. That is those models can serve as a metamodel (in the omg four level hierarchy level m2) but they can serve as a "normal" model (on m1) as well. In order to create the model there are different possibilities - depending on my prefered way (uml, xml schema, java).

Would you agree with this? Thanks again.
Re: Introductory question EMF in general [message #492090 is a reply to message #492086] Sun, 18 October 2009 14:44 Go to previous messageGo to next message
Volker Wegert is currently offline Volker WegertFriend
Messages: 182
Registered: July 2009
Senior Member
Hi, Tom.

Tom <copiod@web.de> writes:
> In order to create the [EMF] model there are different possibilities -
> depending on my prefered way (uml, xml schema, java).

I think the only (small) misunderstanding is here. To simplify: EMF = Ecore +
code generator (hope Ed won't hit me too hard). To use the generator, you need
an Ecore model. You can create it directly or transform some other source (for
example, XML schema) into an Ecore model. I prefer to create the Ecore models
directly and encourage you to do so, at least while you're learning EMF - it's
a lot easier if you don't add another level of model conversions on top.

HTH
Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
"In the Beginning ... It was a nice day." (Terry Pratchett & Neil Gaiman, Good
Omens)
Re: Introductory question EMF in general [message #492098 is a reply to message #492086] Sun, 18 October 2009 16:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Tom,

Yes, that's right.


Tom wrote:
> Thanks for your quick answer Ed!
>
> Ed Merks wrote on Sun, 18 October 2009 06:44
>> It's a floor polish and a dessert topping. :p
>
> good to know ;)
>
> I'll try to summarize: I can define models using EMF but those models
> do not necessarily have to be metamodels. That is those models can
> serve as a metamodel (in the omg four level hierarchy level m2) but
> they can serve as a "normal" model (on m1) as well. In order to create
> the model there are different possibilities - depending on my prefered
> way (uml, xml schema, java).
> Would you agree with this? Thanks again.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Introductory question EMF in general [message #492099 is a reply to message #492090] Sun, 18 October 2009 16:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070009080903060601040606
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Volker,

Comments below.

Volker Wegert wrote:
> Hi, Tom.
>
> Tom <copiod@web.de> writes:
>
>> In order to create the [EMF] model there are different possibilities -
>> depending on my prefered way (uml, xml schema, java).
>>
>
> I think the only (small) misunderstanding is here. To simplify: EMF = Ecore +
> code generator (hope Ed won't hit me too hard).
Note that with dynamic Ecore, you don't actually need to generate the
code for the model to be able to use the model.
> To use the generator, you need
> an Ecore model. You can create it directly or transform some other source (for
> example, XML schema) into an Ecore model. I prefer to create the Ecore models
> directly and encourage you to do so, at least while you're learning EMF - it's
> a lot easier if you don't add another level of model conversions on top.
>
I agree. XML schema is nice when you need to conform to a specific XML
serialization, but if that's not the case you're best off to use Ecore
directly.
> HTH
> Volker
>
>

--------------070009080903060601040606
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Volker,<br>
<br>
Comments below.<br>
<br>
Volker Wegert wrote:
<blockquote cite="mid:844opwpxs7.fsf@zak.home.volker-wegert.de"
type="cite">
<pre wrap="">Hi, Tom.

Tom <a class="moz-txt-link-rfc2396E" href="mailto:copiod@web.de">&lt;copiod@web.de&gt;</a> writes:
</pre>
<blockquote type="cite">
<pre wrap="">In order to create the [EMF] model there are different possibilities -
depending on my prefered way (uml, xml schema, java).
</pre>
</blockquote>
<pre wrap=""><!---->
I think the only (small) misunderstanding is here. To simplify: EMF = Ecore +
code generator (hope Ed won't hit me too hard). </pre>
</blockquote>
Note that with dynamic Ecore, you don't actually need to generate the
code for the model to be able to use the model.<br>
<blockquote cite="mid:844opwpxs7.fsf@zak.home.volker-wegert.de"
type="cite">
<pre wrap="">To use the generator, you need
an Ecore model. You can create it directly or transform some other source (for
example, XML schema) into an Ecore model. I prefer to create the Ecore models
directly and encourage you to do so, at least while you're learning EMF - it's
a lot easier if you don't add another level of model conversions on top.
</pre>
</blockquote>
I agree.&nbsp; XML schema is nice when you need to conform to a specific XML
serialization, but if that's not the case you're best off to use Ecore
directly.<br>
<blockquote cite="mid:844opwpxs7.fsf@zak.home.volker-wegert.de"
type="cite">
<pre wrap="">
HTH
Volker

</pre>
</blockquote>
</body>
</html>

--------------070009080903060601040606--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Introductory question EMF in general [message #492100 is a reply to message #492099] Sun, 18 October 2009 16:42 Go to previous message
Volker Wegert is currently offline Volker WegertFriend
Messages: 182
Registered: July 2009
Senior Member
Ed Merks <Ed.Merks@gmail.com> writes:
> Volker Wegert wrote:
>> I think the only (small) misunderstanding is here. To simplify: EMF = Ecore
>> + code generator (hope Ed won't hit me too hard).
> Note that with dynamic Ecore, you don't actually need to generate the code
> for the model to be able to use the model.

Yep, but please remember that people need learn how to walk before they can
run and fly :-)

>> To use the generator, you need an Ecore model. You can create it directly
>> or transform some other source (for example, XML schema) into an Ecore
>> model. I prefer to create the Ecore models directly and encourage you to do
>> so, at least while you're learning EMF - it's a lot easier if you don't add
>> another level of model conversions on top.
> I agree. XML schema is nice when you need to conform to a specific XML
> serialization, but if that's not the case you're best off to use Ecore
> directly.

Especially because it's small enough to keep in mind and to visualize when
learning EMF. I like you "UMD on training wheels" analogy :-)

Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
The dark ages were caused by the Y1K problem.
Previous Topic:Trouble Loading (Deserializing) EMF Document Outside Of Eclipse (Ganymede)
Next Topic:javascript support for EMF
Goto Forum:
  


Current Time: Fri Apr 26 01:37:14 GMT 2024

Powered by FUDForum. Page generated in 0.04092 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top