Read my DSL model "as a whole" [message #1321425] |
Tue, 29 April 2014 09:20 |
|
Hey!
Suppose i have a quite cool DSL by now (yay ). Now I have some existing generator operating on a large single MagicDraw model currently. What I want to do is swapping the MagicDraw based model implementation with the EMF based for my DSL. For this I need a way to somehow "read all the model files, merge them into one big EMF model", and possibly also save the model for later use.
Now, how (and when) should i best do this? Should i use the xtend generator to update a model when saving one of the files? It's also ok if I have a separate transformation step for this...
Sorry for the noobishness and thanks for the help!
Cheers,
Markus
|
|
|
|
Re: Read my DSL model "as a whole" [message #1321511 is a reply to message #1321433] |
Tue, 29 April 2014 10:26 |
|
Hi,
The term "model" is used too often here i think I have a DSL to model my DB, and each table is in a separate file (simplified). Now i need to have all of them on one big pile...
One question would be how to find all of them (xtext does this already through the classpath, right? how could i re-use this?). Another one is how to get to an EMF model that has all of them instead of only the objects for one file (is there code to do it already?)
|
|
|
|
Re: Read my DSL model "as a whole" [message #1321519 is a reply to message #1321511] |
Tue, 29 April 2014 10:33 |
|
And, yes, thanks for the link, this looks at least near of what i intend to do. only that i will not have the possibility to use xtend there (existing infrastructure). I need to load the model into memory and map all elements to a different type of model. Ideally thre loading of the model should be /fast/, so a "compiled" (serialized, whatever) version of all the single files would be great (a dump of a combined EMF model...?).
|
|
|
|
Re: Read my DSL model "as a whole" [message #1321578 is a reply to message #1321533] |
Tue, 29 April 2014 11:19 |
|
i want to convert the DSL model files to a (non-EMF, handwritten) java-based in-memory model (i.e. instantiate some java classes for each element in the model). For the sake of speed i don't want to read each of the DSL model files each time i need the other model, but want to cache some EMF model as base for the conversion.
what i though about already was reading all of the Resources separately and somehow copying the contents into one single (initially empty) EMF model. This could then be persisted, and re-read if i need the "other model" in different applications.
another approach i was thinking about was having an EMF model on disk and only "updating" (i.e. exchange the whole subtree representing the DSL file's contents) the relevant model parts when saving the DSL file on disk (would that be a viable approach?)
i hope it's clear now - i know that it is a little confusing. we have another 4 "models" somewhere in this game (irrelevant for this), so i myself also have a big brain knot already
|
|
|
|
Powered by
FUDForum. Page generated in 0.03375 seconds