Skip to main content



      Home
Home » Modeling » EMF » Ecore design and derived EReference
Ecore design and derived EReference [message #1173618] Wed, 06 November 2013 11:47 Go to next message
Eclipse UserFriend
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 01:53 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:Uniqueness in derived EReferences
Next Topic:Accessing EMF resource from another file
Goto Forum:
  


Current Time: Wed Jul 09 22:10:19 EDT 2025

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

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

Back to the top