|
|
|
|
|
|
|
|
Re: Generating default XText from XCore/Genmodel [message #1081844 is a reply to message #1081827] |
Wed, 07 August 2013 19:19 |
Miles Parker Messages: 1341 Registered: July 2009 |
Senior Member |
|
|
Jan Kohnlein wrote on Wed, 07 August 2013 14:48I am getting more and more confused
The "New Xtext project from Ecore model" is a very poor way to create an
Xtext language for a given Ecore model as it creates a very generic
syntax that is really just slightly better than XML. I cannot believe it
is useful for any other purpose than to initially scaffold a grammar
from a big Ecore model and refactor that afterwards.
Agreed, I'd hope never to expose my users to that. Though it is (more than slightly) better than XML, which is already an improvement over what everyone else does!
But there is one other case... As I'm exploring the creation of a new domain model, I also need to be able to maintain instances of it. And often you don't know how well something is going to work until you play around w/ instantiations of it.
So what I'd like is a way to make that process of evolution as seamless as possible.
Quote:The proposed Xtext way is to start your language from a grammar with an
inferred Ecore model and switch to an imported - a such manually
maintained - model when the language starts to converge. Up to that
point you didn't care what syntax your Ecore model had been defined in.
But this seems to be a good moment to think about switching to Xcore, as
you will have to change the workflow anyway and because Xcore is likely
easier to maintain.
I'm already committed to using Xcore. And I'm starting w/ a totally fresh model so I don't even have to worry about starting from an inferred Ecore model per se. I could just as easily have defined a grammar in Xtext and ended up w/ one reference model, right?
But here's the problem with that. In my experience, Domain models do not actually make good DSL's and DSL's can make lousy domain models. I think one of the biggest failures of XML (beyond the gruesome syntax) is that it mixes the two. Also of course, there are many things you can specify in xcore that they're aren't semantics for in .xtext. OTOH, what I don't want to do is spend all of my time maintaining two different models. (Added a field to my xcore model, better remember to change that in the grammar too...)
Ideally, you'd be able to simply reuse an Xcore model directly, with some kind of basic assumptions about instantiation grammar, and then have the ability to override those definitions. But that sounds like another CS project.. -- I'd settle for just being able to quickly emit a bare-bones .xtext grammar for an arbitrary xcore file.
Does that make more (or less) sense?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03450 seconds