Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EDAPT] EFactory questions
[EDAPT] EFactory questions [message #1711028] Mon, 12 October 2015 09:28 Go to next message
Eclipse UserFriend
I am wondering if someone could explain a bit about how Edapt chooses an appropriate EFactory for loading an out-dated model during migration. From what I can tell at runtime, a default EFactoryImpl is being used. However, we have extra logic in our EFactory for the createFromString method, so I need a custom implementation.

I'm trying to find if there is a "correct" or "most appropriate" way of handling this provided by the framework. If there is not a built-in method for handling this, will it be enough to retain a base version of the factory with the enhanced createFromString method, and register that to the old namespace URI(s) before migration? I haven't been able to find where the specific version of the EFactory to use for loading the old model is being set. Conceptually, I'm not certain on how I should expect Edapt to be able to handle this.

Thanks for your help!
Re: [EDAPT] EFactory questions [message #1711248 is a reply to message #1711028] Wed, 14 October 2015 06:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi Brad,

sorry for the delayed reply. Johannes will get back to you today or tomorrow.

Cheers,
Maximilian

On 12.10.2015 15:28, Brad Schneider wrote:
> I am wondering if someone could explain a bit about how Edapt chooses an appropriate EFactory for
> loading an out-dated model during migration. From what I can tell at runtime, a default EFactoryImpl
> is being used. However, we have extra logic in our EFactory for the createFromString method, so I
> need a custom implementation.
>
> I'm trying to find if there is a "correct" or "most appropriate" way of handling this provided by
> the framework. If there is not a built-in method for handling this, will it be enough to retain a
> base version of the factory with the enhanced createFromString method, and register that to the old
> namespace URI(s) before migration? I haven't been able to find where the specific version of the
> EFactory to use for loading the old model is being set. Conceptually, I'm not certain on how I
> should expect Edapt to be able to handle this.
>
> Thanks for your help!


--
Maximilian Koegel

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EDAPT] EFactory questions [message #1711284 is a reply to message #1711248] Wed, 14 October 2015 10:36 Go to previous messageGo to next message
Eclipse UserFriend
Hi Brad,

Edapt offers an extension point to register custom efactories. We are currently working on documentation for this feature.
A preliminary version is available from here:
https://docs.google.com/document/d/1lpYRuufQkwI59TpJv3bptkru8iL3fQLbXMxC7lWqQIo/edit?usp=sharing
I will post the final link once available.

Regards
Johannes
Re: [EDAPT] EFactory questions [message #1711374 is a reply to message #1711284] Thu, 15 October 2015 08:05 Go to previous messageGo to next message
Eclipse UserFriend
Thank you guys for the replies. That was exactly what I was looking for.
Re: [EDAPT] EFactory questions [message #1713517 is a reply to message #1711374] Wed, 04 November 2015 12:45 Go to previous messageGo to next message
Eclipse UserFriend
I hate to revive an old thread, but I just realized that this appears to apply only to "top level" packages. For a sub-package within an EPackage inside of a metamodel, it is not possible to use the extension point to override the EFactory. Is this true? Is there a different way to accomplish this?

EDIT: Here's the code I'm referring to in Persistency.class:
for (final EObject element : resource.getContents()) {
				if (element instanceof EPackage) {
					final EPackage ePackage = (EPackage) element;
					FactoryHelper.INSTANCE.overrideFactory(ePackage);
					metamodelResource.getRootPackages().add(ePackage);
				}
			}

That is only iterating over top-level EPackages in the metamodel, and the call to FactoryHelper.overrideFactory(EPackage ePackage) does not iterate over sub-packages for the EPackage, either.

[Updated on: Wed, 04 November 2015 12:53] by Moderator

Re: [EDAPT] EFactory questions [message #1714011 is a reply to message #1713517] Mon, 09 November 2015 06:49 Go to previous message
Eclipse UserFriend
Hi Brad,

Good catch. Could you kindly create a bug-report for this?
Also contributions are always welcome Smile

Cheers
Johannes
Previous Topic:[EMFStore] minor bug
Next Topic:[EMF Forms] Ecore Editor download?
Goto Forum:
  


Current Time: Wed Jul 23 01:45:20 EDT 2025

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

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

Back to the top