Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Ecore design and derived EReference
Ecore design and derived EReference [message #1173618] Wed, 06 November 2013 16:47 Go to next message
Pascal Gula is currently offline Pascal GulaFriend
Messages: 5
Registered: November 2013
Junior Member
Hi,
I am working on a model with a simplified version in the picture attached.
Basically, a resource (which will be chained in the final model) is defining a number of global parameters and several methods. Each methods are also defining their own parameters, but in addition to that, the methods should be able to use the global parameters defined by the (future top level) resource.
Like shown in the diagram, is it possible and the best design decision to create a derived EReference for the global parameters that will be automatically computed to be the one defined by the top level resource?
Thanks and have a nice evening,
Pascal
Re: Ecore design and derived EReference [message #1174547 is a reply to message #1173618] Thu, 07 November 2013 06:53 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Pascal,

Yes, that seems reasonable, but be a little careful how you implement
it, i.e., don't just return getResource().getGlobalParameters(), but
rather look at how
org.eclipse.emf.ecore.impl.EClassImpl.getEAllReferences() uses
org.eclipse.emf.ecore.util.EcoreEList.UnmodifiableEList.FastCompare for
the list it returns. Alternatively you could provide an EOperation that
provides the same API and in that case you could just return the
resources's actual list (though you might still want to return a
read-only wrapper of it).

On 06/11/2013 6:57 PM, Pascal Gula wrote:
> Hi,
> I am working on a model with a simplified version in the picture attached.
> Basically, a resource (which will be chained in the final model) is defining a number of global parameters and several methods. Each methods are also defining their own parameters, but in addition to that, the methods should be able to use the global parameters defined by the (future top level) resource.
> Like shown in the diagram, is it possible and the best design decision to create a derived EReference for the global parameters that will be automatically computed to be the one defined by the top level resource?
> Thanks and have a nice evening,
> Pascal
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Uniqueness in derived EReferences
Next Topic:Accessing EMF resource from another file
Goto Forum:
  


Current Time: Fri Apr 19 14:00:43 GMT 2024

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

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

Back to the top