Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Extending an existing model in EMF
Extending an existing model in EMF [message #420923] Wed, 16 July 2008 15:11 Go to next message
David Savage is currently offline David SavageFriend
Messages: 6
Registered: July 2009
Junior Member
Hi,

I'm just starting out with EMF but have decided to leap in at the deep
end and wondering if someone can throw me any pointers towards land.

I've come to EMF because I would like to integrate our current eclipse
tool set http://sigil.codecauldron.org which helps developers build
applications for deployment within Newton (newton.codecauldron.org).
with the eclipse STP project.

The initial point of integration with STP I'd like to work on will be in
providing extension points to the SCA model. This is where I have
started looking into your model as the SCA model is built using EMF.

I have so far been investigating and guessing about how things may work,
but it would be useful if some EMF guru's out there can confirm where my
assumptions are correct/incorrect/unintelligible. I can obviously also
ask on the STP list but as I'm starting out with EMF I suspect some of
my questions are going to be on the basic side.

Firstly it seems that the SCA model is implemented by parsing a set of
XSD documents into an ecore file. Can someone point me in the direction
of any documentation that shows how this transformation works? In
another part of the STP project one ecore model seems to import the
initial STP ecore project via a link - again any pointers about how this
works would be very useful to me.

Secondly within various parts of the SCA xsd model there are points that
allow extension by third parties via the <xsd:any /> element. In EMF
this seems to be translated into an EAttribute Type EFeatureMapEntry
[org.eclipse.emf.ecore.util.FeatureMap$Entry].

Within our model used in Newton and therefore by extension in Sigil we
provide a number of such extension points and I'm trying to figure out
how to go about declaring these extension points to the EMF framework.
Do I need to start out at the xsd level or can I use java interfaces
that extend org.eclipse.emf.ecore.util.FeatureMp$Entry or both (and in
the case of both being valid are there any subtleties that would warrant
me choosing one route over another).

Many thanks in advance for any feedback.

Regards,

Dave
Re: Extending an existing model in EMF [message #420928 is a reply to message #420923] Wed, 16 July 2008 15:32 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070605070301000408050009
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

David,

Comments below.

David Savage wrote:
> Hi,
>
> I'm just starting out with EMF but have decided to leap in at the deep
> end and wondering if someone can throw me any pointers towards land.
>
> I've come to EMF because I would like to integrate our current eclipse
> tool set http://sigil.codecauldron.org which helps developers build
> applications for deployment within Newton (newton.codecauldron.org).
> with the eclipse STP project.
>
> The initial point of integration with STP I'd like to work on will be
> in providing extension points to the SCA model. This is where I have
> started looking into your model as the SCA model is built using EMF.
>
> I have so far been investigating and guessing about how things may
> work, but it would be useful if some EMF guru's out there can confirm
> where my assumptions are correct/incorrect/unintelligible. I can
> obviously also ask on the STP list but as I'm starting out with EMF I
> suspect some of my questions are going to be on the basic side.
>
> Firstly it seems that the SCA model is implemented by parsing a set of
> XSD documents into an ecore file. Can someone point me in the
> direction of any documentation that shows how this transformation works?

http://www.eclipse.org/modeling/emf/docs/
Binding XML to Java
< http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava>
XML Schema to Ecore Mapping
< http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf>
Tutorial: Generating an EMF Model using XML Schema
< http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc/tutorials/xlibmod/xlibmod.html>

> In another part of the STP project one ecore model seems to import the
> initial STP ecore project via a link - again any pointers about how
> this works would be very useful to me.
Not sure what you mean by a link. You mean cross document references
between .ecore resources? Those work pretty much like hrefs in a .html
document.
>
> Secondly within various parts of the SCA xsd model there are points
> that allow extension by third parties via the <xsd:any /> element. In
> EMF this seems to be translated into an EAttribute Type
> EFeatureMapEntry [org.eclipse.emf.ecore.util.FeatureMap$Entry].
Kind of gross. The documents above talk about them.
>
> Within our model used in Newton and therefore by extension in Sigil we
> provide a number of such extension points and I'm trying to figure out
> how to go about declaring these extension points to the EMF framework.
You don't really have to declare anything with extension points.
You'll just be able to do things like
x.getAny().add(MyPackage.Literals.DOCUMENT_ROOT__SOME_ELEMEN T,
<value-of-some-element's-type>).
> Do I need to start out at the xsd level or can I use java interfaces
> that extend org.eclipse.emf.ecore.util.FeatureMp$Entry or both (and in
> the case of both being valid are there any subtleties that would
> warrant me choosing one route over another).
Think of these as similar to java.util.Map.Entry; you won't ever need to
implement one. You need to populate them with feature/value pairs as I
showed above.
>
> Many thanks in advance for any feedback.
The XML binding paper will help a lot.
>
> Regards,
>
> Dave
>
>

--------------070605070301000408050009
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">
David,<br>
<br>
Comments below.<br>
<br>
David Savage wrote:
<blockquote cite="mid:g5l326$9oj$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
I'm just starting out with EMF but have decided to leap in at the deep
end and wondering if someone can throw me any pointers towards land.
<br>
<br>
I've come to EMF because I would like to integrate our current eclipse
tool set <a class="moz-txt-link-freetext" href="http://sigil.codecauldron.org">http://sigil.codecauldron.org</a> which helps developers build
applications for deployment within Newton (newton.codecauldron.org).
with the eclipse STP project.
<br>
<br>
The initial point of integration with STP I'd like to work on will be
in providing extension points to the SCA model. This is where I have
started looking into your model as the SCA model is built using EMF.
<br>
<br>
I have so far been investigating and guessing about how things may
work, but it would be useful if some EMF guru's out there can confirm
where my assumptions are correct/incorrect/unintelligible. I can
obviously also ask on the STP list but as I'm starting out with EMF I
suspect some of my questions are going to be on the basic side.
<br>
<br>
Firstly it seems that the SCA model is implemented by parsing a set of
XSD documents into an ecore file. Can someone point me in the direction
of any documentation that shows how this transformation works?</blockquote>
<blockquote><a href="http://www.eclipse.org/modeling/emf/docs/">http://www.eclipse.org/modeling/emf/docs/</a><br>
<a target="_out"
href=" http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava">Binding
XML to Java</a><br>
<a
href=" http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf">XML
Schema to Ecore Mapping</a><br>
<a
href=" http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc/tutorials/xlibmod/xlibmod.html">Tutorial:
Generating an EMF Model using XML Schema</a></blockquote>
<blockquote cite="mid:g5l326$9oj$1@build.eclipse.org" type="cite"> In
another part of the STP project one ecore model seems to import the
initial STP ecore project via a link - again any pointers about how
this works would be very useful to me.
<br>
</blockquote>
Not sure what you mean by a link.&nbsp; You mean cross document references
between .ecore resources?&nbsp; Those work pretty much like hrefs in a .html
document.<br>
<blockquote cite="mid:g5l326$9oj$1@build.eclipse.org" type="cite"><br>
Secondly within various parts of the SCA xsd model there are points
that allow extension by third parties via the &lt;xsd:any /&gt;
element. In EMF this seems to be translated into an EAttribute Type
EFeatureMapEntry [org.eclipse.emf.ecore.util.FeatureMap$Entry].
<br>
</blockquote>
Kind of gross.&nbsp; The documents above talk about them.<br>
<blockquote cite="mid:g5l326$9oj$1@build.eclipse.org" type="cite"><br>
Within our model used in Newton and therefore by extension in Sigil we
provide a number of such extension points and I'm trying to figure out
how to go about declaring these extension points to the EMF framework.</blockquote>
You don't really have to declare anything with extension points.&nbsp;&nbsp;
You'll just be able to do things like
x.getAny().add(MyPackage.Literals.DOCUMENT_ROOT__SOME_ELEMEN T,
&lt;value-of-some-element's-type&gt;).<br>
<blockquote cite="mid:g5l326$9oj$1@build.eclipse.org" type="cite"> Do I
need to start out at the xsd level or can I use java interfaces that
extend org.eclipse.emf.ecore.util.FeatureMp$Entry or both (and in the
case of both being valid are there any subtleties that would warrant me
choosing one route over another).
<br>
</blockquote>
Think of these as similar to java.util.Map.Entry; you won't ever need
to implement one.&nbsp; You need to populate them with feature/value pairs
as I showed above.<br>
<blockquote cite="mid:g5l326$9oj$1@build.eclipse.org" type="cite"><br>
Many thanks in advance for any feedback.
<br>
</blockquote>
The XML binding paper will help a lot.<br>
<blockquote cite="mid:g5l326$9oj$1@build.eclipse.org" type="cite"><br>
Regards,
<br>
<br>
Dave
<br>
<br>
<br>
</blockquote>
</body>
</html>

--------------070605070301000408050009--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:no bugs for bugday
Next Topic:General usage of EMF and trivial fine-tuning concerns
Goto Forum:
  


Current Time: Wed Apr 24 23:14:45 GMT 2024

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

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

Back to the top