Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Newbie question on round tripping
Newbie question on round tripping [message #893006] Mon, 02 July 2012 09:21 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 5
Registered: September 2010
Junior Member
Hello together,

for a while now i was working on a tool to create ABAP code(an SAP programming language) from UMLs. I did this project with acceleos eclipse plugin and it worked basically like a charm.
But after the first few try's i realized that working with models without the possibility to change the model via round tripping/reverse engineering is somewhat useless.
So i decided to redo my work, but actually i have no idea how this is supposed to work, which i why i am asking here for some input.
How ould one start to generate out of an XML valid UML models? As far as i can see there is no easy way in acceleo so i looked into xtext+xpand because professional software companies have done it that way.
So i would basically generate my ABAP coding with an xpand workflow, but again how do i reverse the process?
This would be a simple class with an attribute.

<?xml version="1.0" encoding="UTF-8"?>
<uml:Package xmi:version="2.1" xmlns:xmi="...
  <packageImport xmi:id="_packageImport.0">
    <importedPackage href="dataType.uml#_0"/>
  </packageImport>
  <packagedElement xmi:type="uml:Class" xmi:id="zcl_2" name="zcl_2">
    <ownedAttribute xmi:id="zcl_2-test" name="test" visibility="public">
      <type xmi:type="uml:PrimitiveType" href="dataType.uml#hrobject"/>
      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="zcl_2-test-_upperValue" value="1"/>
      <lowerValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="zcl_2-test-_lowerValue" value="1"/>
    </ownedAttribute>
  </packagedElement>
</uml:Package>


in the moment i get something like this:

<xml>
<class name="ZCL_1>
class ZCL_HR_LSO_AQ_SERVICES definition
  public
  create public .
<attribute...>
 data test type string.
...
</xml>


So what would i have to to to get the UML XML out of my own XML? Or maybe i am totally on the wrong path and there are other/better solutions to my problem?

I am thankful for any comments/hints.

Regards
Mathias
Re: Newbie question on round tripping [message #893602 is a reply to message #893006] Wed, 04 July 2012 19:13 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 211
Registered: July 2009
Senior Member
Hi Mathias,

here are a few thoughts:

* For the XML2UML transformation, there are several approaches: You could create an ecore out of your schema, use a XML parser etc.
* But your XML is not well suited for M2M transformation, since a lot of information seems to be contained in CDATA, which you'd need to parse (could be done with Xtext).
* As soon as you'd have a structured in memory-representation of your XML, you could use Java, QVTO, Xtend2 and a number of others for M2M transformation and just store the resulting UML resource. Currently, I'd recommend Xtend2, because you'd have the same language for M2M as for M2T transformations.
* You'd only get the UML semantic models, no diagrams etc. The diagram generation would depend on the specific tool that you use.

On a more general level, it would be important what you want to achieve. If you would like to just have a graphical programming of ABAP represented by UML or reverse engineer existing ABAPs then it might be a viable approach.

However, if you go for model driven development, I would recommend roundtripping only in very rare cases(and this might be a flamebait for the small parts of MDE community still advocating it Smile You just can't get the benefits of increased abstraction with it.

So, depending on the intention and scope of your project, you might want to dive into MDE a little more and see where the industry is now.

[Updated on: Wed, 04 July 2012 19:15]

Report message to a moderator

Re: Newbie question on round tripping [message #893931 is a reply to message #893602] Fri, 06 July 2012 06:28 Go to previous message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 5
Registered: September 2010
Junior Member
Hi Andreas,
thank you very much for this information. My approach is the MDE way, i am not so much interested in the Diagrams. That "recommending roundtripping in a rare case" is new to me, but hey i will follow your suggestions and dive deeper into MDE Smile again, thanks for your time and help
Previous Topic:Individuall deployment folder for generated files (xtend2/xtext2)
Next Topic:How to invoke Xtext parser/JvmModelInferrer from a Java project
Goto Forum:
  


Current Time: Mon May 25 22:17:22 GMT 2020

Powered by FUDForum. Page generated in 0.01835 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top