Community
Participate
Working Groups
Build Identifier: Hi, some thoughts on the example of the Xtext 1.0.1 I would start a bit simpler than the current example, e.g. - remove the entity interitance feature in the metamodel - remove the * support for multiplicity support in the metamodel. the reason is that new persons really get a bit confused when too much features are presented in the first place. Esp. the * once as syntax and once as Xtext mutiplicity confuesed students a bit. Additionally the inheritance really needs a constraint to be really usefull (or entity A could inherit from entity A). so I propose: 1. start with a simpler meta model 2. add the multiplicity in a later step 3. add the entity inheritance in a later step 4. add a constraint for the entity inheritance I would start with the following meta model: if you point me to the doc sources i can also fix this. grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" DomainModel: (elements+=Type)*; Type: Datatype | Entity; Entity: 'entity' name=ID '{' (features+=Feature)* '}'; Datatype: 'datatype' name=ID; Feature: name=ID ':' type=[Type]; Reproducible: Always
as further comment: for students i usually start with a plain EMF example. Initially this was in the oAW or Xtext tutorial but at some time was removed. Why ? IMO teaching them the plain EMF example first has the following advantages: - they know about emf and ecore at all :-) - they have to build the meta model by hand and feel the pain - they also have to add the genmodel and build by hand and feel the pain - they have to build the data model and build instance via tree, again pain after that I proceed with Xtext and they really appreciate all the support and magic of Xtext, also the textual vs. "tree and fiddling" approach. so how about adding the EMF stuff as an (optional) preceeding chapter to the chapter 2 ?
The sources are in the project org.eclipse.xtext.doc. The repository containing the project is hosted on git.eclipse.org. We are currently migrating from one documentation language to another, so it's not the best moment to improve the content. :-) I'll tell you when the migration is finished. Btw. it's the grammar not the meta model. And if you want to refer to the meta model in the tutorial, please call it the "ecore model", because that's the EMF terminology we use. (In reply to comment #1) > as further comment: for students i usually start with a plain EMF example. > Initially this was in the oAW or Xtext tutorial but at some time was removed. > Why ? IMO teaching them the plain EMF example first has the following > advantages: > - they know about emf and ecore at all :-) They don't have to. It's a tutorial. > - they have to build the meta model by hand and feel the pain > - they also have to add the genmodel and build by hand and feel the pain > - they have to build the data model and build instance via tree, again pain You really think a tutorial should be painful? > so how about adding the EMF stuff as an (optional) preceeding chapter to the > chapter 2 ? No, thanks. :-) We have some information about EMF later and think it's good to have it there. The tutorial is really meant to get people started in short time. We want to leave out everything which is not absolutely necessary.
okay the more important stuff really was the proposal 1. start with a simpler grammar 2. add the multiplicity in a later step 3. add the entity inheritance in a later step 4. add a constraint for the entity inheritance I hope you agree with that, so after migration this could be changed ? ;-) > Btw. it's the grammar not the meta model. And if you want to refer to the meta hm, in Xtext we mix abstract and concrete syntax within one file. the xtext file. so it is grammar + meta model IMO :-) (but we are getting ... now :-) > model in the tutorial, please call it the "ecore model", because that's the EMF > terminology we use. ok > You really think a tutorial should be painful? no, thats not the target at all but i improves a bit the understanding of EMF and what Xtext is doing automagically for you and behind the scenes... that is the reason why i first make a plain EMF exercises. but of course i can keep this private and for my own purposes.
The tutorial has been completely reworked. Please reopen if it does not fit your needs.
Closing all bugs that were set to RESOLVED before Neon.0