Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [incquery-dev] incquery & xcore integration

Hi,

Separation to two projects:
- In the existing version of query-based features, I have solved that issue by simply not adding the incquery project as a dependency to the model project. Instead, the required query specification was retrieved from the QuerySpecificationRegistry by it's fully qualified name. While you can also use this approach, you will have to make sure that the queries are registered into the QuerySpecificationRegisrty of the running Eclipse. Since the registry only allows adding and not replacing, a better approach would be to use a pattern registry for the dynamic case.
- But, as Zoltán has pointed out, separating the two projects would introduce several new problems for the one that it might solve.

Evaluator code in the dynamic case:
- From a quick look at setting delegates (http://wiki.eclipse.org/EMF/New_and_Noteworthy/Helios#Support_for_Feature_Setting_Delegates show me some more up to date content if you can) I think we just have to create a QueryBasedFeatureSettingDelegate and it's factory and use that in the same way as it is used for Xcore. Instead of parsing an Xcore _expression_, it will the QueryBasedFeatureHandler and retreive the value for the given source. Once initialized, the handler will keep the value of the feature updated and send notifications.
- I have pushed a QueryBasedFeatureSettingDelegate and its Factory to the repository. As I don't fully know how setting delegates work, it may not be correct. However, it should give you a way to register the factory either through annotations or manually in the dynamic case and after that EMF will hopefully just call it as it does other delegates. As before, I would like to see some more documentation on the lifecycle and working of delegates, since that may include information that would impact the implementation of this delegate.

Cheers,
  Ábel Hegedüs

Fault Tolerant Systems Research Group
Department of Measurement and Information Systems
Budapest University of Technology and Economics

On 2013.06.21. 14:19:06, Tamas Szabo <tamas.szabo@xxxxxxxxx> wrote:

Hi

The progress with the incquery & xcore integration is a bit slow at the
moment because I'm stuck with an annoying issue:
-Occasionally my test project gets corrupted and in the xcore file the
primitive types cannot be found. The proposal provider proposes the
String/Int/etc types but after selecting it, it is marked as an
erroneous part in the text. After many attempts, experiments I think
this is related to the fact that the project has both incquery and xtext
natures and somehow the xtext builder gets corrupted (??). I have
mentioned this behavior to Ed too.

-If I use two different projects (one for incquery and one for xcore)
then how should I handle the dependencies? The incquery project should
depend on the xcore project because of the generated metamodel, the
xcore project should depend on the incquery project because of the
defined patterns and the generated code (which will be used when
evaluating the derived feature). Having the two things in the same
project at least avoided the cyclic dep. problem.

-Suppose there is an incquery based derived feature defined as follows:
derived Int numberOfBooks spec library.numberOfBooksOfWriter
In this case (1) the derived feature "evaluator" code should be injected
into the EMF model code (this is fine, as this can be done easily with
special annotations in ecore) (2) when creating a dynamic instance model
it should be also invoked somehow. In xcore the
EStructuralFeature.Internal.SettingDelegate#dynamicGet is used for this
case and the xbase _expression_ is interpreted on the fly with the
XbaseInterpreter class. For incquery there is no xbase code in the
derived feature definition only the pattern fqn, so first the
appropriate xbase code should be created? Other option is to implement
it with reflection, what do you think? How to handle the imports (those
classes which are used currently in Abel's implementation)?

I look forward to hear you ideas/opinions. If somebody wants to help
more then I gladly share the existing code parts and some sample project.

Cheers,
Tamas
_______________________________________________
incquery-dev mailing list
incquery-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/incquery-dev

Back to the top