Hi!
I have an xtext-dsl that I used to generate different artifacts from (i.e. SQL-Files, XML-File...).
Now I have a requirement to enrich the model with additional info before the code generation (i.e. info that comes from a jdbc datasource).
1) I downloaded the latest xtext-distribution and from what I understand I should do the generation of artifacts with xtend instead of xpand now. Is that correct?
2) I am a little bit lost in all the generated plugin-projects ragarding where that custom model-enrichment part would go. Any suggestions here?
> Hi!
> I have an xtext-dsl that I used to generate different artifacts from (i.e.
> SQL-Files, XML-File...). Now I have a requirement to enrich the model with
> additional info before the code generation (i.e. info that comes from a
> jdbc datasource).
>
> 1) I downloaded the latest xtext-distribution and from what I understand I
> should do the generation of artifacts with xtend instead of xpand now. Is
> that correct?
>
> 2) I am a little bit lost in all the generated plugin-projects ragarding
> where that custom model-enrichment part would go. Any suggestions here?
>
> thnx and regards,
>
> mgie
Just one additional question:
In my xtend-generator I need to retrieve some information from a database.
So far my db-accessor gets instantiated and connects from within the xtend-generator,
which means that every change in my dsl triggers this action (as long as "Build Automatically" is switched on).
Is there a place in the language infrastructure where i can initialize a singleton of that Accessor and inject it
into the xtend-generator?
Am 25.02.13 11:09, schrieb m gie:
> Ok, that sound reasonable. I am gonna try that.
>
> Just one additional question:
> In my xtend-generator I need to retrieve some information from a database.
> So far my db-accessor gets instantiated and connects from within the
> xtend-generator,
> which means that every change in my dsl triggers this action (as long as
> "Build Automatically" is switched on).
> Is there a place in the language infrastructure where i can initialize a
> singleton of that Accessor and inject it
> into the xtend-generator?
>
>
Depends on what you do in the enrichment step.
I'd rather go for some extension methods to add methods with the needed
functionality in the generator, because the model is also used by other
components which might get confused.
Am 22.02.13 12:35, schrieb m gie:
> Hi!
> I have an xtext-dsl that I used to generate different artifacts from
> (i.e. SQL-Files, XML-File...).
> Now I have a requirement to enrich the model with additional info before
> the code generation (i.e. info that comes from a jdbc datasource).
>
> 1) I downloaded the latest xtext-distribution and from what I understand
> I should do the generation of artifacts with xtend instead of xpand now.
> Is that correct?
>
> 2) I am a little bit lost in all the generated plugin-projects ragarding
> where that custom model-enrichment part would go. Any suggestions here?
>
> thnx and regards,
>
> mgie