BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
Xtext: Eclipse Modeling Framework
1. Eclipse Modeling Framework
EMF provides code generation facilities
for building applications based on structured data models
model specification can be done using UML
Xtext
automatically infers EMF-metamodel for DSL
uses EMF to create abstract syntax tree
can also use existing metamodel & generate grammar
instances of EMF classes must be created through a static factory
fields (features) are initialized using getters and setters
or other ways
2. Ecore model
features
collection of entities
of the model
EMF analogue of string
reference
reference
feature name – when resolving cross-references,
objects are checked against this feature
class hierarchy
base type
extends base type
BasicType, EntityType
become subclasses of FieldType
3. Ecore model
IntConstant, StringConstant, BoolConstant, FieldRef
become subclasses of Expression
PrintStatement, AssignmentStatement
become subclasses of Statement
represented as string
if both PrintStatement
and
AssignmentStatement
had feature expression,
then Statement
would have field
expression
feature expression
feature expr
no fields