Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EDAPT] EFactory questions
[EDAPT] EFactory questions [message #1711028] Mon, 12 October 2015 13:28 Go to next message
Brad Schneider is currently offline Brad SchneiderFriend
Messages: 4
Registered: July 2015
Junior Member
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 10:10 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 253
Registered: July 2009
Senior Member
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 14:36 Go to previous messageGo to next message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 101
Registered: December 2013
Senior Member

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


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EDAPT] EFactory questions [message #1711374 is a reply to message #1711284] Thu, 15 October 2015 12:05 Go to previous messageGo to next message
Brad Schneider is currently offline Brad SchneiderFriend
Messages: 4
Registered: July 2015
Junior Member
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 17:45 Go to previous messageGo to next message
Brad Schneider is currently offline Brad SchneiderFriend
Messages: 4
Registered: July 2015
Junior Member
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 17:53]

Report message to a moderator

Re: [EDAPT] EFactory questions [message #1714011 is a reply to message #1713517] Mon, 09 November 2015 11:49 Go to previous message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 101
Registered: December 2013
Senior Member

Hi Brad,

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

Cheers
Johannes


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:[EMFStore] minor bug
Next Topic:[EMF Forms] Ecore Editor download?
Goto Forum:
  


Current Time: Fri Apr 19 23:29:43 GMT 2024

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

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

Back to the top