Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

MDA in der Praxis - Modelltransformation und Code-Generierung mit dem Enterprise Architect

14,203 views

Published on

TechTalk von Olaf Maibaum (DLR Braunschweig, 21.10.2008).

Published in: Technology
  • Sie können Hilfe bekommen bei ⇒ www.WritersHilfe.com ⇐. Erfolg und Grüße!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

MDA in der Praxis - Modelltransformation und Code-Generierung mit dem Enterprise Architect

  1. 1. MDA in der Praxis Modelltransformation und Code-Generierung mit dem Enterprise Architect Dr. Olaf Maibaum, DLR Simulations- und Softwaretechnik
  2. 2. Übersicht <ul><li>Profile </li></ul><ul><li>Transformationen </li></ul><ul><ul><li>UML -> UML </li></ul></ul><ul><ul><li>UML -> Source Code </li></ul></ul><ul><li>Schreiben von Transformationen </li></ul><ul><li>Transformationen am Beispiel Rodos </li></ul><ul><li>Fazit </li></ul>
  3. 3. Profile <ul><li>Profile reichern die UML mit eigenen spezifischen Sprachinhalte an </li></ul><ul><ul><li>Kapseln von Modell-Abstraktionen </li></ul></ul><ul><ul><li>Wiederverwenden von Elementen aus einem Entwicklungs-Framework </li></ul></ul><ul><ul><li>Modellieren der Elemente einer GUI </li></ul></ul><ul><li>Profile definieren Stereotypen für UML-Elemente </li></ul><ul><li>Jeder Stereotyp kann mit Tagged Values versehen werden </li></ul><ul><li>Stereotypen und Tagged Values steuern Transformationen </li></ul><ul><ul><li>UML -> UML </li></ul></ul><ul><ul><li>UML -> Code </li></ul></ul>
  4. 4. Profile erstellen <ul><li>Öffnen eines Klassendiagramms </li></ul><ul><li>Aus den Tools UML-Profile auswählen </li></ul><ul><li>Das Profile-Element aus der Toolbox in das Klassendiagramm ziehen und das Profile benennen </li></ul><ul><li>EA erweitert das Projekt um einen Namensraum mit Stereotyp „profile“ </li></ul><ul><li>In dem Namensraum können nun Klassendiagramme angelegt werden </li></ul>
  5. 5. Stereotypen anlegen <ul><li>Jeder Stereotyp ist einem UML-Element zugeordnet </li></ul><ul><li>Als erstes ist eine Meta-Klasse in ein Klassendiagramm zu ziehen </li></ul><ul><li>In der erscheinenden Auswahlbox sind die entsprechenden Elemente zu wählen, welche mit Stereotypen angereichert werden sollen </li></ul><ul><li>Einen Konnektor von der Meta-Klasse aus ziehen und die Extend-Beziehung wählen, um einen Stereotypen zu definieren </li></ul><ul><li>Alternativ Toolbox nutzen </li></ul>
  6. 6. Stereotypen um Tagged Values erweitern <ul><li>Der Stereotyp kann durch den Eigenschaftsdialog entsprechend bearbeitet werden </li></ul><ul><li>Tagged Values werden als Attribute eines Stereotypen definiert </li></ul><ul><li>Diese Daten können später im Editor durch den Nutzer bearbeitet werden </li></ul><ul><li>Im Beispiel eines Thread-Stereotypen: </li></ul><ul><ul><li>Name </li></ul></ul><ul><ul><li>Priorität </li></ul></ul><ul><ul><li>Timingwerte </li></ul></ul>
  7. 7. Constraints <ul><li>Jedem Stereotypen oder Tagged Value können Bedingungen für eine Validierung im Reiter Constraints gegeben werden </li></ul><ul><li>Beispiel: </li></ul><ul><ul><li>Eine Assoziation mit Stereotyp send ist immer auf eine Klasse mit Stereotypen Message gerichtet </li></ul></ul><ul><ul><li>Einem Tagged Value priority des Stereotypen Thread ist definiert </li></ul></ul>OCL-Beispiel ist falsch
  8. 8. Profile speichern <ul><li>Kontextmenü zum Namensraum des Stereotypen „Save Package as UML Modell </li></ul><ul><li>Als UML 2.0 speicher! </li></ul><ul><li>Gegebenenfalls Stereotypen noch sortieren für eine einfachere Nutzung </li></ul>
  9. 9. Profil laden <ul><li>Vom Projekt-Browser in Ressourcen wechseln </li></ul><ul><li>Im Kontext-Menü des „UML Profile“ „Import Profile“ wählen </li></ul><ul><li>XML-Datei mit dem Profile wird importiert </li></ul>
  10. 10. Profile nutzen <ul><li>Drag und Drop der Elemente aus dem Ressourcen-Bereich des Editors in ein Diagramm </li></ul><ul><li>Auswahl des Profiles aus der Tool-Auswahl und dann Drag und Drop aus der Toolbox </li></ul>
  11. 11. Transformationen UML -> UML <ul><li>Auflösen einer Abstraktionsebene </li></ul><ul><ul><li>Hinzufügen von Hilfsklassen oder Modellpatterns </li></ul></ul><ul><ul><li>Hinzufügen von Assoziationen </li></ul></ul><ul><ul><li>Hinzufügen von Attributen und Operationen </li></ul></ul><ul><li>Ändern genereller Elemente-Einstellungen </li></ul><ul><ul><li>Eigenschaft Containment im Ziel einer Aggregation wird mit „Value“ versehen (Standard für eingebetteten System) </li></ul></ul><ul><li>Spezifizieren auf ein Framework </li></ul><ul><ul><li>Hinzufügen von Standardattributen und -operationen des verwendeten Frameworks </li></ul></ul><ul><ul><li>Hinzufügen von Modellpatterns </li></ul></ul><ul><ul><li>Überführen von Stereotypen in Stereotypen eines Frameworks </li></ul></ul>
  12. 12. Transformationen UML -> Code <ul><li>Eigentlich Code-Generator </li></ul><ul><li>Standardüberführung von UML-Klassendiagrammen in die Zielsprache </li></ul><ul><li>Erstellen von spezialisierten Code aus Stereotypen und Tagged Values </li></ul><ul><ul><li>Ererbung von Schnittstellen und Ableiten von Basisklassen </li></ul></ul><ul><ul><li>Erweitern der Attribute und Methoden </li></ul></ul><ul><ul><li>Erzeugen von ausführbaren Code für Helfermethoden des verwendeten Framework, z. B. </li></ul></ul><ul><ul><ul><li>Initialisierung </li></ul></ul></ul><ul><ul><ul><li>Anmeldung </li></ul></ul></ul><ul><ul><ul><li>Abmeldung </li></ul></ul></ul><ul><ul><ul><li>Standardoperationen </li></ul></ul></ul><ul><ul><li>Parametrisieren durch Tagged Values </li></ul></ul>
  13. 13. Zugriff auf Templates <ul><li>Unter dem Menü „Settings“ </li></ul><ul><li>Code Generation Templates </li></ul><ul><ul><li>UML -> Code </li></ul></ul><ul><li>Transformation Templates </li></ul><ul><ul><li>UML -> UML </li></ul></ul>
  14. 14. Template Editor (1) Auswahl eines Sprachpakets
  15. 15. Template Editor (2) Anlegen von neuen Sprachpaketen
  16. 16. Template Editor (3) Templates einer Sprache Die Spalte Modified gibt an, ob das Template angepasst wurde
  17. 17. Template Editor (4) Mit Stereotypen überschriebene Templates
  18. 18. Template Editor (5) <ul><li>Anlegen neuer Templates: </li></ul><ul><li>komplett neu </li></ul><ul><li>Mit Stereotypen überschrieben </li></ul>
  19. 19. Template Editor (6) Speichern oder Löschen des ausgewählten Template
  20. 20. Template ergänzen <ul><li>Zum Anlegen eines neuen Templates </li></ul><ul><ul><li>Das betreffende UML-Element als Template Type wählen </li></ul></ul><ul><ul><li>Einen Namen vergeben </li></ul></ul><ul><ul><li>EA vergibt als Namen immer <UMLType>__<Name> (Zwei ´_´ ! ) </li></ul></ul><ul><ul><li>Das erzeugte Template ist leer </li></ul></ul><ul><li>Zum Überschreiben eines Template mit einem Stereotypen </li></ul><ul><ul><li>Die entsprechenden Stereotypen wählen (Class, Feature) </li></ul></ul><ul><ul><li>Das erzeugte Template ist eine Kopie des überschriebenen Templates </li></ul></ul>
  21. 21. Ablauf einer Transformation <ul><li>Für jede Klasse wird eine Transformation durchgeführt </li></ul><ul><li>Es wird immer mit dem Template File begonnen </li></ul><ul><li>Für Sprachen mit getrennter Definition und Implementierung </li></ul><ul><ul><li>File für Definition </li></ul></ul><ul><ul><li>File Impl für Implementierung </li></ul></ul><ul><li>Alle anderen Templates müssen direkt oder indirekt durch File aufgerufen werden </li></ul><ul><li>Mit Stereotypen überschrieben Templates werden implizit ausgewählt, falls das zu übersetzende Objekt den Stereotypen besitzt </li></ul><ul><li>Ergebnis einer Transformation ist ein Text </li></ul>
  22. 22. Exportieren/Importieren <ul><li>Im Menü Tools: </li></ul><ul><li>Export Reference Data </li></ul><ul><li>Import Reference Data </li></ul><ul><li>Eine xml Datei kann einen ganzen Satz an Transformationen beinhalten </li></ul>
  23. 23. Beispiel RODOS UML -> UML
  24. 24. Class Template für Stereotypen Thread <ul><li>%elemType% </li></ul><ul><li>{ </li></ul><ul><li>%TRANSFORM_REFERENCE(&quot;Class&quot;)% </li></ul><ul><li>%TRANSFORM_CURRENT()% </li></ul><ul><li>%list=&quot;ClassParameter&quot; @separator=&quot; &quot; @indent=&quot; &quot;% </li></ul><ul><li>%list=&quot;ClassBase&quot; @separator=&quot; &quot; @indent=&quot; &quot;% </li></ul><ul><li>%list=&quot;ClassInterface&quot; @separator=&quot; &quot; @indent=&quot; &quot;% </li></ul><ul><li>%list=&quot;InnerClass&quot; @separator=&quot; &quot; @indent=&quot; &quot;% </li></ul><ul><li>%list=&quot;Attribute&quot; @separator=&quot; &quot; @indent=&quot; &quot;% </li></ul><ul><li>%list=&quot;Operation&quot; @separator=&quot; &quot; @indent=&quot; &quot;% </li></ul><ul><li>stereotype = &quot;Thread&quot; </li></ul><ul><li>notes = %qt%%classNotes%%qt% </li></ul><ul><li>Tag </li></ul><ul><li>{ </li></ul><ul><li>name = &quot;name&quot; </li></ul><ul><li>value = %qt%%classTag:&quot;name&quot;%%qt% </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>%list=&quot;Connector&quot; @separator=&quot; &quot;% </li></ul>
  25. 25. Ergänzung zu Template Namespace <ul><li>$threadPriorities=%list=&quot;Class__ThreadPriorities&quot; @separator=&quot; &quot; @indent=&quot; &quot;% </li></ul><ul><li>$threadTimings=%list=&quot;Class__ThreadTiming&quot; @separator=&quot; &quot; @indent=&quot; &quot;% </li></ul><ul><li>Package </li></ul><ul><li>{ </li></ul><ul><li>name = &quot;Configuration&quot; </li></ul><ul><li>Class </li></ul><ul><li>{ </li></ul><ul><li>notes = &quot;Defines the priority, start and period time of threads&quot; </li></ul><ul><li>stereotype = &quot;enumeration&quot; </li></ul><ul><li>Tag </li></ul><ul><li>{ </li></ul><ul><li>$comment = &quot;name = asCppDefintion falls #define erzeugt werden soll&quot; </li></ul><ul><li>name = &quot;suppressUndefined&quot; </li></ul><ul><li>value = &quot;T&quot; </li></ul><ul><li>} </li></ul><ul><li>name = &quot;ThreadConfiguration&quot; </li></ul><ul><li>$threadPriorities </li></ul><ul><li>$threadTimings </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  26. 26. Neues Template ClassThread__Timing <ul><li>%if classStereotype!=&quot;Thread&quot;% </li></ul><ul><li>%endTemplate% </li></ul><ul><li>$startName = &quot;TIMING_START_&quot;+%TO_UPPER(className)% </li></ul><ul><li>$periodName = &quot;TIMING_PERIOD_&quot;+%TO_UPPER(className)% </li></ul><ul><li>Attribute </li></ul><ul><li>{ </li></ul><ul><li>type = &quot;Nanoseconds&quot; </li></ul><ul><li>name = %qt%$startName%qt% </li></ul><ul><li>default = %qt%%classTag:&quot;startAt&quot;%%qt% </li></ul><ul><li>} </li></ul><ul><li>Attribute </li></ul><ul><li>{ </li></ul><ul><li>type = &quot;Nanoseconds&quot; </li></ul><ul><li>name = %qt%$periodName%qt% </li></ul><ul><li>default = %qt%%classTag:&quot;startEvery&quot;%%qt% </li></ul><ul><li>} </li></ul>
  27. 27. Beispiel RODOS UML -> Code <ul><li>[--- snip ---] </li></ul><ul><li>/** </li></ul><ul><li>* Body of the thread Alice </li></ul><ul><li>*/ </li></ul><ul><li>void run() </li></ul><ul><li>{ </li></ul><ul><li>// Define thread timing </li></ul><ul><li>setPeriodicBeat(Configuration::TIMING_START_RECEIVER,Configuration::TIMING_PERIOD_RECEIVER); </li></ul><ul><li>while(1) </li></ul><ul><li>{ </li></ul><ul><li>waitUntilNextBeat(); </li></ul><ul><li>// fill in your thread body here </li></ul><ul><li>} </li></ul>
  28. 28. Überladung für Stereotyp „Thread“ von „Class Body Impl“ (1) <ul><li>%if classTag:&quot;name&quot; != &quot;&quot;% </li></ul><ul><li>$threadName = %classTag:&quot;name&quot;% </li></ul><ul><li>%else% </li></ul><ul><li>$threadName = %className% </li></ul><ul><li>%endIf% </li></ul><ul><li>$startName = &quot;Configuration::TIMING_START_&quot;+%TO_UPPER(className)% </li></ul><ul><li>$periodName = &quot;Configuration::TIMING_PERIOD_&quot;+%TO_UPPER(className)% </li></ul><ul><li>// Initialization of thread $threadName </li></ul><ul><li>void init() </li></ul><ul><li>{ </li></ul><ul><li>// fill in your initializations here </li></ul><ul><li>} </li></ul>
  29. 29. Überladung für Stereotyp „Thread“ von „Class Body Impl“ (2) <ul><li>/* </li></ul><ul><li>* Body of the thread $threadName </li></ul><ul><li>*/ </li></ul><ul><li>void run() </li></ul><ul><li>{ </li></ul><ul><li>// Define thread timing </li></ul><ul><li>setPeriodicBeat($startName,$periodName); </li></ul><ul><li>while(1) </li></ul><ul><li>{ </li></ul><ul><li>waitUntilNextBeat(); </li></ul><ul><li>// fill in your thread body here </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  30. 30. Statt „enumeration“ ein „#define“ verwenden <ul><li>Ergänzen enumeration-Überladung einer Klasse: </li></ul><ul><ul><li>%ClassNotes% </li></ul></ul><ul><ul><li>%if classTag:&quot;asCppDefintion&quot;==&quot;T&quot;% </li></ul></ul><ul><ul><li>%list=&quot;Attribute__asCppDefinition&quot; @separator=&quot; &quot;% </li></ul></ul><ul><ul><li>%endTemplate% </li></ul></ul><ul><li>Neues Template Attribute__asCppDefinition </li></ul><ul><ul><li>%if attInitial!=&quot;&quot;% </li></ul></ul><ul><ul><li>#define %attName% (%attInitial%) </li></ul></ul>
  31. 31. Hilfe zur Erstellung von Transformationen <ul><li>Abschnitt MDA Transforms </li></ul><ul><li>Code Engineering </li></ul><ul><ul><li>Code Template Framework </li></ul></ul><ul><li>Extend Enterprise Architect - Software Developers Kit </li></ul><ul><ul><li>Code Template Framework in SDK </li></ul></ul>
  32. 32. Fazit <ul><li>Positiv </li></ul><ul><ul><li>Anwendung der MDA erspart Modellierungszeit </li></ul></ul><ul><ul><li>Immer wiederkehrender Code kann automatisch erzeugt werden </li></ul></ul><ul><li>Negativ </li></ul><ul><ul><li>Schreiben der Templates ist recht komplex </li></ul></ul><ul><ul><li>Dokumentation der Template-Syntax ist dürftig </li></ul></ul><ul><ul><li>Debugging der Templates ist schwierig </li></ul></ul><ul><ul><li>Es gibt implizite Regeln für die Code-Erzeugung, welche sich nicht beeinflussen lassen </li></ul></ul><ul><ul><ul><li>Bsp: Bei Stereotyp <<enumeration>> wird „file impl“ nicht aufgerufen, ansonsten immer </li></ul></ul></ul>

×