SlideShare a Scribd company logo
ATL の紹介




©Actier, Inc. All rights reserved.
自己紹介

 名前 : 大島則人
 所属 : 株式会社アクティア 代表取締役社長
 URL : http://www.actier.co.jp
 技術領域
  Java アーキテクト
  モデル駆動型ソフトウェア開発




            ©Actier, Inc. All rights reserved.
ATL 概要




©Actier, Inc. All rights reserved.
ATL の概要

   モデル変換言語
     あるメタモデルで定義されたモデルを別のメタ
    モデルで定義されたモデルへ変換するための言
    語




                 ©Actier, Inc. All rights reserved.
もう少し分かり易く…


                                              Ecore は MOF の EMF 実装


  UML                CWM


         変換プログラ
            ム
UMLモデル            CWMモデル



                                     UML                        独自メタモデ
                                                                   ル

                                                       変換プログラ
                                                          ム
                               UMLモデル                           独自モデル


                  ©Actier, Inc. All rights reserved.
ATL が扱うメタモデル

   ECore で定義したモデル
          は、Eclipse の MOF 実装
     ECore
     → EMF UML2 などのメタモデルに利用される


   実体は…
        のスキーマ定義のようなもの (XMI)
     XML
     → 独自のメタモデルを作れる!
     → 独自の XML を扱える!




                  ©Actier, Inc. All rights reserved.
ATL の環境構築




 ©Actier, Inc. All rights reserved.
ATL の環境構築①

   Eclipse Modeling Tools を利用




                 ©Actier, Inc. All rights reserved.
ATL の環境構築②

   Install Modeling Components を選択




                 ©Actier, Inc. All rights reserved.
ATL の環境構築③

   ATL を選ぶだけ!




             ©Actier, Inc. All rights reserved.
Tutorial で ATL を感じる




     ©Actier, Inc. All rights reserved.
モデル変換の全体イメージ




  Families                                Persons

       Families2Persons
Familiesモデ                               Personsモデル
     ル


             ©Actier, Inc. All rights reserved.
ATL の Tutorial


                これはメタモデル




Family の構造を定義                                        Person の構造を定義




                ©Actier, Inc. All rights reserved.
UML メタモデルと UML モデル(イメージ)




                                        ← メタモデル




                                Class                  Class#name



モデル →                                                     Attribute#type
                     Attribute
                                             Attribute#name




        ©Actier, Inc. All rights reserved.
FamiliesメタモデルとFamiliesモデル




                                      ↓ このような表記と仮定すると…

                        Family               Family#lastName

                                                           Member#father

                                                           Member#mother
                  Member
                                                           Member#sons

                                                          Member#daughters
                         Member#firstName



        ©Actier, Inc. All rights reserved.
Families モデルの定義


 March                                                 Sailor


         Jim                                                    Peter



         Cindy                                                  Jackie



     Brandon                                                    David



         Brenda                                                 Dylan



                                                                 Kelly




                  ©Actier, Inc. All rights reserved.
Persons モデルのイメージ

  Jim March                Dylan Sailor               Cindy March




Brandon March                                         Brenda March




 Peter Sailor                                         Jackie Sailor




 David Sailor                                          Kelly Sailor




                 ©Actier, Inc. All rights reserved.
ATL Project の作成




         ©Actier, Inc. All rights reserved.
メタモデルを作る

   ECore Diagram を使うと直感的




              ©Actier, Inc. All rights reserved.
Families メタモデル




        ©Actier, Inc. All rights reserved.
Persons メタモデル




       ©Actier, Inc. All rights reserved.
モデル変換定義①

   ATL ファイルを作成する




            ©Actier, Inc. All rights reserved.
モデル変換定義②

   扱うメタモデルを設定する




           ©Actier, Inc. All rights reserved.
モデル変換定義③




     ©Actier, Inc. All rights reserved.
ATL テンプレート




      ©Actier, Inc. All rights reserved.
モデル変換コードを作る




   ©Actier, Inc. All rights reserved.
ATL 変換コードの構造

   モデル変換ルール定義
     From   のモデルを To のモデルへ変換するルール



   Helper 定義
     メタモデルを拡張する属性や操作の定義




                 ©Actier, Inc. All rights reserved.
モデル変換の概略

                                                          fullName


lastName


     firstName
                                                       Member -> Male

     firstName
                   Member!isFemale()                  Member!familyName

     firstName
                                                      Member -> Female

     firstName
                                                           fullName




                 ©Actier, Inc. All rights reserved.
isFemale()



helper context Families!Member def: isFemale(): Boolean =
  if not self.familyMother.oclIsUndefined() then
      true
  else
      if not self.familyDaughter.oclIsUndefined() then
          true
      else
          false
      endif
  endif;




                      ©Actier, Inc. All rights reserved.
familyName

helper context Families!Member def: familyName: String =
  if not self.familyFather.oclIsUndefined() then
      self.familyFather.lastName
  else
      if not self.familyMother.oclIsUndefined() then
          self.familyMother.lastName
      else
          if not self.familySon.oclIsUndefined() then
              self.familySon.lastName
          else
              self.familyDaughter.lastName
          endif
      endif
  endif;
                      ©Actier, Inc. All rights reserved.
モデル変換ルール

rule Member2Male {
   from
      s: Families!Member (not s.isFemale())
   to
      t: Persons!Male (
         fullName <- s.firstName + ' ' + s.familyName
      )
}

rule Member2Female {
   from
      s: Families!Member (s.isFemale())
   to
      t: Persons!Female (
         fullName <- s.firstName + ' ' + s.familyName
      )
}

                   ©Actier, Inc. All rights reserved.
モデル変換を実行する




  ©Actier, Inc. All rights reserved.
Families モデルを作る

   自分で定義したモデルのエディタはないので
    …

   XML ファイルを直接書く! xmlns=“http://families/1.0">
     <?xml version="1.0" encoding="ISO-8859-1"?>
     <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
      <Family lastName="March">
       <father firstName="Jim"/>                                        ECoreDiagram を使った場合のケア
       <mother firstName="Cindy"/>
       <sons firstName="Brandon"/>
       <daughters firstName="Brenda"/>
      </Family>
      <Family lastName="Sailor">
       <father firstName="Peter"/>
       <mother firstName="Jackie"/>
       <sons firstName="David"/>
       <sons firstName="Dylan"/>
       <daughters firstName="Kelly"/>
      </Family>
     </xmi:XMI>


                                   ©Actier, Inc. All rights reserved.
atl ファイルを実行する




      ©Actier, Inc. All rights reserved.
変換されたモデル


<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:persons="http://persons/1.0">
 <persons:Male fullName="Jim March"/>
 <persons:Male fullName="Brandon March"/>
 <persons:Male fullName="Peter Sailor"/>
 <persons:Male fullName="David Sailor"/>
 <persons:Male fullName="Dylan Sailor"/>
 <persons:Female fullName="Cindy March"/>
 <persons:Female fullName="Brenda March"/>
 <persons:Female fullName="Jackie Sailor"/>
 <persons:Female fullName="Kelly Sailor"/>
</xmi:XMI>




                                    ©Actier, Inc. All rights reserved.
まとめ




©Actier, Inc. All rights reserved.
モデル変換の全体イメージ




  Families                                Persons

       Families2Persons
Familiesモデ                               Personsモデル
     ル


             ©Actier, Inc. All rights reserved.
モデル変換の利用

   どのような場合に利用する?
     MDA の PIM -> PSM 変換
      プラットフォーム独立モデルからプラット
      フォーム特化モデルへの変換
     UML モデルを UML モデルへ
      UML ツール毎の違いを吸収
     UML モデルを独自の XML(DSL) へ
     独自の XML(DSL) を UML モデルへ
     独自の XML(DSL A) を別形式の XML(DSL B) へ




                ©Actier, Inc. All rights reserved.

More Related Content

Recently uploaded

This is the company presentation material of RIZAP Technologies, Inc.
This is the company presentation material of RIZAP Technologies, Inc.This is the company presentation material of RIZAP Technologies, Inc.
This is the company presentation material of RIZAP Technologies, Inc.
chiefujita1
 
Generating Automatic Feedback on UI Mockups with Large Language Models
Generating Automatic Feedback on UI Mockups with Large Language ModelsGenerating Automatic Feedback on UI Mockups with Large Language Models
Generating Automatic Feedback on UI Mockups with Large Language Models
harmonylab
 
ReonHata_便利の副作用に気づかせるための発想支援手法の評価---行為の増減の提示による気づきへの影響---
ReonHata_便利の副作用に気づかせるための発想支援手法の評価---行為の増減の提示による気づきへの影響---ReonHata_便利の副作用に気づかせるための発想支援手法の評価---行為の増減の提示による気づきへの影響---
ReonHata_便利の副作用に気づかせるための発想支援手法の評価---行為の増減の提示による気づきへの影響---
Matsushita Laboratory
 
JSAI_類似画像マッチングによる器への印象付与手法の妥当性検証_ver.3_高橋りさ
JSAI_類似画像マッチングによる器への印象付与手法の妥当性検証_ver.3_高橋りさJSAI_類似画像マッチングによる器への印象付与手法の妥当性検証_ver.3_高橋りさ
JSAI_類似画像マッチングによる器への印象付与手法の妥当性検証_ver.3_高橋りさ
0207sukipio
 
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアルLoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
CRI Japan, Inc.
 
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
Toru Tamaki
 
キンドリル ネットワークアセスメントサービスご紹介 今のネットワーク環境は大丈夫? 調査〜対策までご支援します
キンドリル ネットワークアセスメントサービスご紹介 今のネットワーク環境は大丈夫? 調査〜対策までご支援しますキンドリル ネットワークアセスメントサービスご紹介 今のネットワーク環境は大丈夫? 調査〜対策までご支援します
キンドリル ネットワークアセスメントサービスご紹介 今のネットワーク環境は大丈夫? 調査〜対策までご支援します
Takayuki Nakayama
 
遺伝的アルゴリズムと知識蒸留による大規模言語モデル(LLM)の学習とハイパーパラメータ最適化
遺伝的アルゴリズムと知識蒸留による大規模言語モデル(LLM)の学習とハイパーパラメータ最適化遺伝的アルゴリズムと知識蒸留による大規模言語モデル(LLM)の学習とハイパーパラメータ最適化
遺伝的アルゴリズムと知識蒸留による大規模言語モデル(LLM)の学習とハイパーパラメータ最適化
t m
 

Recently uploaded (8)

This is the company presentation material of RIZAP Technologies, Inc.
This is the company presentation material of RIZAP Technologies, Inc.This is the company presentation material of RIZAP Technologies, Inc.
This is the company presentation material of RIZAP Technologies, Inc.
 
Generating Automatic Feedback on UI Mockups with Large Language Models
Generating Automatic Feedback on UI Mockups with Large Language ModelsGenerating Automatic Feedback on UI Mockups with Large Language Models
Generating Automatic Feedback on UI Mockups with Large Language Models
 
ReonHata_便利の副作用に気づかせるための発想支援手法の評価---行為の増減の提示による気づきへの影響---
ReonHata_便利の副作用に気づかせるための発想支援手法の評価---行為の増減の提示による気づきへの影響---ReonHata_便利の副作用に気づかせるための発想支援手法の評価---行為の増減の提示による気づきへの影響---
ReonHata_便利の副作用に気づかせるための発想支援手法の評価---行為の増減の提示による気づきへの影響---
 
JSAI_類似画像マッチングによる器への印象付与手法の妥当性検証_ver.3_高橋りさ
JSAI_類似画像マッチングによる器への印象付与手法の妥当性検証_ver.3_高橋りさJSAI_類似画像マッチングによる器への印象付与手法の妥当性検証_ver.3_高橋りさ
JSAI_類似画像マッチングによる器への印象付与手法の妥当性検証_ver.3_高橋りさ
 
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアルLoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
 
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
 
キンドリル ネットワークアセスメントサービスご紹介 今のネットワーク環境は大丈夫? 調査〜対策までご支援します
キンドリル ネットワークアセスメントサービスご紹介 今のネットワーク環境は大丈夫? 調査〜対策までご支援しますキンドリル ネットワークアセスメントサービスご紹介 今のネットワーク環境は大丈夫? 調査〜対策までご支援します
キンドリル ネットワークアセスメントサービスご紹介 今のネットワーク環境は大丈夫? 調査〜対策までご支援します
 
遺伝的アルゴリズムと知識蒸留による大規模言語モデル(LLM)の学習とハイパーパラメータ最適化
遺伝的アルゴリズムと知識蒸留による大規模言語モデル(LLM)の学習とハイパーパラメータ最適化遺伝的アルゴリズムと知識蒸留による大規模言語モデル(LLM)の学習とハイパーパラメータ最適化
遺伝的アルゴリズムと知識蒸留による大規模言語モデル(LLM)の学習とハイパーパラメータ最適化
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Atl の紹介

  • 1. ATL の紹介 ©Actier, Inc. All rights reserved.
  • 2. 自己紹介  名前 : 大島則人  所属 : 株式会社アクティア 代表取締役社長  URL : http://www.actier.co.jp  技術領域 Java アーキテクト モデル駆動型ソフトウェア開発 ©Actier, Inc. All rights reserved.
  • 3. ATL 概要 ©Actier, Inc. All rights reserved.
  • 4. ATL の概要  モデル変換言語  あるメタモデルで定義されたモデルを別のメタ モデルで定義されたモデルへ変換するための言 語 ©Actier, Inc. All rights reserved.
  • 5. もう少し分かり易く… Ecore は MOF の EMF 実装 UML CWM 変換プログラ ム UMLモデル CWMモデル UML 独自メタモデ ル 変換プログラ ム UMLモデル 独自モデル ©Actier, Inc. All rights reserved.
  • 6. ATL が扱うメタモデル  ECore で定義したモデル は、Eclipse の MOF 実装  ECore → EMF UML2 などのメタモデルに利用される  実体は… のスキーマ定義のようなもの (XMI)  XML → 独自のメタモデルを作れる! → 独自の XML を扱える! ©Actier, Inc. All rights reserved.
  • 7. ATL の環境構築 ©Actier, Inc. All rights reserved.
  • 8. ATL の環境構築①  Eclipse Modeling Tools を利用 ©Actier, Inc. All rights reserved.
  • 9. ATL の環境構築②  Install Modeling Components を選択 ©Actier, Inc. All rights reserved.
  • 10. ATL の環境構築③  ATL を選ぶだけ! ©Actier, Inc. All rights reserved.
  • 11. Tutorial で ATL を感じる ©Actier, Inc. All rights reserved.
  • 12. モデル変換の全体イメージ Families Persons Families2Persons Familiesモデ Personsモデル ル ©Actier, Inc. All rights reserved.
  • 13. ATL の Tutorial これはメタモデル Family の構造を定義 Person の構造を定義 ©Actier, Inc. All rights reserved.
  • 14. UML メタモデルと UML モデル(イメージ) ← メタモデル Class Class#name モデル → Attribute#type Attribute Attribute#name ©Actier, Inc. All rights reserved.
  • 15. FamiliesメタモデルとFamiliesモデル ↓ このような表記と仮定すると… Family Family#lastName Member#father Member#mother Member Member#sons Member#daughters Member#firstName ©Actier, Inc. All rights reserved.
  • 16. Families モデルの定義 March Sailor Jim Peter Cindy Jackie Brandon David Brenda Dylan Kelly ©Actier, Inc. All rights reserved.
  • 17. Persons モデルのイメージ Jim March Dylan Sailor Cindy March Brandon March Brenda March Peter Sailor Jackie Sailor David Sailor Kelly Sailor ©Actier, Inc. All rights reserved.
  • 18. ATL Project の作成 ©Actier, Inc. All rights reserved.
  • 19. メタモデルを作る  ECore Diagram を使うと直感的 ©Actier, Inc. All rights reserved.
  • 20. Families メタモデル ©Actier, Inc. All rights reserved.
  • 21. Persons メタモデル ©Actier, Inc. All rights reserved.
  • 22. モデル変換定義①  ATL ファイルを作成する ©Actier, Inc. All rights reserved.
  • 23. モデル変換定義②  扱うメタモデルを設定する ©Actier, Inc. All rights reserved.
  • 24. モデル変換定義③ ©Actier, Inc. All rights reserved.
  • 25. ATL テンプレート ©Actier, Inc. All rights reserved.
  • 26. モデル変換コードを作る ©Actier, Inc. All rights reserved.
  • 27. ATL 変換コードの構造  モデル変換ルール定義  From のモデルを To のモデルへ変換するルール  Helper 定義  メタモデルを拡張する属性や操作の定義 ©Actier, Inc. All rights reserved.
  • 28. モデル変換の概略 fullName lastName firstName Member -> Male firstName Member!isFemale() Member!familyName firstName Member -> Female firstName fullName ©Actier, Inc. All rights reserved.
  • 29. isFemale() helper context Families!Member def: isFemale(): Boolean = if not self.familyMother.oclIsUndefined() then true else if not self.familyDaughter.oclIsUndefined() then true else false endif endif; ©Actier, Inc. All rights reserved.
  • 30. familyName helper context Families!Member def: familyName: String = if not self.familyFather.oclIsUndefined() then self.familyFather.lastName else if not self.familyMother.oclIsUndefined() then self.familyMother.lastName else if not self.familySon.oclIsUndefined() then self.familySon.lastName else self.familyDaughter.lastName endif endif endif; ©Actier, Inc. All rights reserved.
  • 31. モデル変換ルール rule Member2Male { from s: Families!Member (not s.isFemale()) to t: Persons!Male ( fullName <- s.firstName + ' ' + s.familyName ) } rule Member2Female { from s: Families!Member (s.isFemale()) to t: Persons!Female ( fullName <- s.firstName + ' ' + s.familyName ) } ©Actier, Inc. All rights reserved.
  • 32. モデル変換を実行する ©Actier, Inc. All rights reserved.
  • 33. Families モデルを作る  自分で定義したモデルのエディタはないので …  XML ファイルを直接書く! xmlns=“http://families/1.0"> <?xml version="1.0" encoding="ISO-8859-1"?> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" <Family lastName="March"> <father firstName="Jim"/> ECoreDiagram を使った場合のケア <mother firstName="Cindy"/> <sons firstName="Brandon"/> <daughters firstName="Brenda"/> </Family> <Family lastName="Sailor"> <father firstName="Peter"/> <mother firstName="Jackie"/> <sons firstName="David"/> <sons firstName="Dylan"/> <daughters firstName="Kelly"/> </Family> </xmi:XMI> ©Actier, Inc. All rights reserved.
  • 34. atl ファイルを実行する ©Actier, Inc. All rights reserved.
  • 35. 変換されたモデル <?xml version="1.0" encoding="ISO-8859-1"?> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:persons="http://persons/1.0"> <persons:Male fullName="Jim March"/> <persons:Male fullName="Brandon March"/> <persons:Male fullName="Peter Sailor"/> <persons:Male fullName="David Sailor"/> <persons:Male fullName="Dylan Sailor"/> <persons:Female fullName="Cindy March"/> <persons:Female fullName="Brenda March"/> <persons:Female fullName="Jackie Sailor"/> <persons:Female fullName="Kelly Sailor"/> </xmi:XMI> ©Actier, Inc. All rights reserved.
  • 36. まとめ ©Actier, Inc. All rights reserved.
  • 37. モデル変換の全体イメージ Families Persons Families2Persons Familiesモデ Personsモデル ル ©Actier, Inc. All rights reserved.
  • 38. モデル変換の利用  どのような場合に利用する?  MDA の PIM -> PSM 変換 プラットフォーム独立モデルからプラット フォーム特化モデルへの変換  UML モデルを UML モデルへ UML ツール毎の違いを吸収  UML モデルを独自の XML(DSL) へ  独自の XML(DSL) を UML モデルへ  独自の XML(DSL A) を別形式の XML(DSL B) へ ©Actier, Inc. All rights reserved.