Christian works as a developer and consultant for itemis AG in Stuttgart/Germany. He is interested in model driven software development, especially textual DSLs with Xtext.
I am using XPand/Xtend for dynamic EMF to code generation and now I want to migrate existing Xpand/Xtend project to Xtend. I got to know that XTend is a successor of Xpand. It means I can do everything that is possible with Xpand/Xtend to latest version of Xtend (www.eclipse.org/xtend).
I understand that Xtend is a statically-typed programming language which translates to comprehensible Java source code. I also read in some blog that dynamic EMF feature is not available in the Xtend which was previously available with XPand/Xtend. If this is true then I would like to know how can I use Xtend with dynamic metamodel which is not finalized before build.
Let me try to summarize the question:
I have an XSD schema (Static Meta Model) and another meta model (Dynamic meta model) which is generated from the values of an xml file whose tags are defined in the XSD schema. Right now I am able to use Dynamic meta model in case of Xpand/Xtend but now what is the way out in case of Xtend?
Thanks and Regards, Hemal Bavishi
there is not way out besides turning you dynamic stuff to somehow static stuff. but if you have an xsd schema it is not really dynamic. you can use the xsd importer to generate an ecore and generate the java classes for that ecore by creating a corresponding genmodel (this is the same a the xsd adaptor of xpand does it on the fly)
OKay. I understand that there is no way out except creating an ecore model out of an xml file. The problem is I have one XSD schema file and second one is the intended metamodel in the form of xml whose tags are defined in the schema file. If I understand from your reply correctly, I need to convert intended metamodel to ecore and then generate java classes and use these classes to build the project based on Xtend. Is this understanding correct?
If the above understanding is correct then how can I convert intended metamodel whose tags are defined in the schema file to ecore model?
Schema file :- http://www.autosar.org/specifications/release-41/methodology-and-templates/templates/AUTOSAR MMOD XMLSchema
Intended Meta Model: http://www.autosar.org/specifications/release-41/methodology-and-templates/templates/AUTOSAR MOD ECUConfigurationParameters
Thanks and Regards,
if you target autosar simply use artop (+ maybe eclipse sphinx)
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.