Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Loading Xtext model without direct dependency to xtext plugin
Loading Xtext model without direct dependency to xtext plugin [message #1752656] Wed, 25 January 2017 20:34 Go to next message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Hey guys,

well, the title is already a little contradicting I think, but I'll try to explain our problem:


  • We have an external developer who wants to write additional plug-ins for our application.
    For these plug-ins he needs the Model of our language, so we put the whole model in an own plug-in (model is created with Xcore)
  • Note that the .xtext-file and the other Xtext stuff (StandaloneSetup, Validator, Generator, , etc.) still is in another bundle.

Now we come to the part were it gets tricky. The external developer wants to test his plug-in. In order to do this he wants to load model files . But we don't want to provide him with the xtext plug-ins of our DSL.
Is there a way that he can load models without having a dependency to our plug-in containing the Xtext stuff, or should we try another concept to solve our problem?

I already found 2 solutions, but it seems like there always has to be the dependency to the plug-in which contains the .xtext file for the DSL:



Thanks for your help! =)


Re: Loading Xtext model without direct dependency to xtext plugin [message #1752679 is a reply to message #1752656] Thu, 26 January 2017 05:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Three questions

(1) indirect dependency is allowed and thus yourdsl is deployed in the environment of the client?
(2) is it allowed to have a direct dependency to xtext itself
(3) is the client allowed to know/use your file extension


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Loading Xtext model without direct dependency to xtext plugin [message #1752697 is a reply to message #1752679] Thu, 26 January 2017 09:28 Go to previous messageGo to next message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Hi Christian,

(1) Unfortunately, indirect dependency is NOT allowed too, this should be the last resort for solving this problem
(2) A dependency to xtext itself would be no problem
(3) Yes, he knows our file extension and is allowed to use it

Thanks so far. =)
Re: Loading Xtext model without direct dependency to xtext plugin [message #1752700 is a reply to message #1752697] Thu, 26 January 2017 09:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
so you would give them no access to your languages at all?!?

this means that your extension points operate on an already loaded model ?!?
or should the development stuff and the production stuff work completely different,
which means "integration at the end user side ?!?"

if so why cannot create the developer of the third party plugins artifical xmi instances of the xcore himself and use these for their work ?!?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Loading Xtext model without direct dependency to xtext plugin [message #1752704 is a reply to message #1752700] Thu, 26 January 2017 11:53 Go to previous messageGo to next message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Well, he gets access to the model, but not to the languages... =) That was the plan....

But this would be just the case for developing the unit tests. In our application of course the dsl plugins are included in order to load files with the corresponding extensions.

XMI instances would be a good alternative, but these also cannot be loaded from an dsl-file WITHOUT the dependency to the dsl plugin, can they?
The problem is, if they could not be loaded from a file, then the XMI instances have to be created programmatically, and this is no option, because our model is rather complicated...

I think we go with the option, that our client gets access to our dsl plugins..

Thanks for your great support! =)



Re: Loading Xtext model without direct dependency to xtext plugin [message #1752705 is a reply to message #1752704] Thu, 26 January 2017 11:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
well what i want to tell you: you can let your developers your dsl without a direct dependency to your dsls.
so if your dsls are in the target platform that would be perfectly fine


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Loading Xtext model without direct dependency to xtext plugin [message #1753094 is a reply to message #1752705] Wed, 01 February 2017 19:47 Go to previous messageGo to next message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Hey Christian,

thanks again for your various hints.

I would like to ask you something about your last posting. What do you mean with "direct dependency"?
I put the DSLs in the target platform. OK, that's clear to me. But if someone is developing a plug-in he still have to put the dependencies to the DSL plugins into the MANIFEST.MF, am I right? We are using maven with tycho, by the way, no maven dependencies =).
So, if the developer is putting the DSL plugins into the MANIFEST.MF, this is a direct dependency, or do you mean something different?




Re: Loading Xtext model without direct dependency to xtext plugin [message #1753097 is a reply to message #1753094] Wed, 01 February 2017 20:07 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
no with indirect dependencies i mean:

(1) the dsls are in the target platform
(2) you don`t put a dependency to manifest

you do this (pseudo code)

	public void doSomethingWith(IFile file) {
		URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
		IProject project = file.getProject();
		IResourceServiceProvider rsp = IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(uri);
		ResourceSet rs = rsp.get(IResourceSetProvider.class).get(project);
		Resource r = rs.getResource(uri, true);
		r.load(null);
		...
	}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:prevent compiling in xtext-maven-plugin
Next Topic:Indexing/Linking order problem
Goto Forum:
  


Current Time: Fri Apr 19 18:31:15 GMT 2024

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

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

Back to the top