モデル - Software Engineering Laboratory

Download Report

Transcript モデル - Software Engineering Laboratory

メタモデル記述を用いた成果物間
の依存関係追跡手法
井上研究室
博士前期課程2年
大平 直宏
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
1
モデル駆動型開発

モデル駆動型開発(MDD:Model Driven Development)



全工程を通してモデル※1 をソフトウェア開発の中心とする新しい開発手法
モデルの自動変換,検証,実行といった高度なプログラム処理による効率化
開発者の手の介入を減らすことによる設計漏れ防止,高品質化
※1 “モデル” = オブジェクト指向分析・設計に基づいて対象の情報を抽象化
したもの.自然言語で記述されていた仕様書や設計書はUML
を用いてモデルとして記述されることが多い
<struts-config>
<datasources></datasources>
<form-beans>
<formbean name="BeginFor
m" type="struts.BeginF
orm" />
モデル化
顧客の
要求
要件定義
モデル化
画面の
遷移
システム
の構造
設計
実装
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
2
問題点

モデル駆動型の開発手法を実現するにあたって
成果物であるモデルをいかに管理するのか
モデルとその間の依存関係を追跡可能な状態で
 成果物の仕様は所属組織,開発方法論,フレームワークなどで異なる
2. モデル間の依存関係をいかに管理するのか
統一的かつ厳密に管理できる枠組みが必要
1.



モデルが仕様を満たしていることを検証する方法がない
モデルは他のモデルとの関係の中で作られる
依存関係にあるモデル群を一貫した状態で管理しなければならない
依存関係
開発者
仕様と
モデルの
ギャップ
記述仕様
詳細化
詳細化
モデル化
モデル化
顧客の
要求
記述仕様
画面の
遷移
記述仕様
システム
の構造
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
3
研究内容と位置づけ
モデル駆動型による効率的なソフトウェア開発
の実現
モデルの自動
変換
モデルの
検証
モデリングツール
の統合
モデルの
実行
 モデルとその依存関係を統一的に管理する
枠組みの提案
(メタモデルを扱う技術としてMOFに着目)
 Strutsフレームワークの画面遷移設計に適用
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
4
目次
MOF概要
 提案手法

メタモデルを用いた成果物の管理
メタモデルを用いた依存関係の管理
依存関係の定義
 依存情報の蓄積


支援システム
Strutsの画面遷移設計へ適用
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
5
MOF(Meta Object Facility)
オブジェクト指向設計にもとづいて
メタモデルを定義するためのOMG
標準言語
 UMLは同じ性質のオブジェクトを
UMLクラスとして抽象化
 MOFは同じ性質のメタオブジェク
トをMOFクラスとして抽象化

MOFクラス
(メタモデル)
モデル化
MOF
オブジェクト
UMLクラス
(モデル)
 メタオブジェクトは他のオブジェクトの
性質を規定するオブジェクト(≒UML
クラス)

MOFリポジトリを生成可能
2006/02/20
モデル化
対象の
情報
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
6
MOFリポジトリ

MOFで記述したメタモデルに対して,そのスキーマに従うイン
スタンスを管理できるリポジトリを生成可能
メタモデ
ル
<<meta-model>>
A
1
*
B
1
0..1
Generate
MOFリポジトリ
C
メタモデル設計者
モデル
(インスタン
ス)
MOFクラス群
格納OK
格納OK
格納NG
<<model>>
A1: A
B1: B
<<model>>
A1: A
B1: B
<<model>>
A1: A
B1: B
C1: C
B2: B
開発者A
MOFオブジェクト群
2006/02/20
開発者B
C1: C
開発者C
メタモデル
修士論文発表会
違反
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
7
目次
MOF概要
 提案手法

メタモデルを用いた成果物の管理
メタモデルを用いた依存関係の管理
依存関係の定義
 依存情報の蓄積


支援システム
Strutsの画面遷移設計へ適用
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
8
成果物の管理(1/2)

成果物のメタモデル
(MOFクラス)
仕様とモデルのギャップが問題
 成果物の仕様をメタモデルとして形式的
メタモデル設計者
リポジトリ生成
に定義する
 開発者にメタモデルのインスタンスとして
モデルを作成させる
instanceof
モデル(MOF
オブジェクト)
開発者
開発者
モデル化
記述仕様
画面の
遷移
仕様と
モデルの
ギャップ
記述仕様
モデル化
モデル化
画面の
遷移
記述仕様
システム
の構造
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
9
成果物の管理(2/2)
メタモデル設計者
instanceof
メタモデルと
モデルの
比較
モデル(MOF
オブジェクト)
開発者
モデル化
記述仕様
2006/02/20
成果物の仕様をメタモデルとして
定義
 開発者が作成したモデルを
MOFリポジトリで管理
 モデルがメタモデルを満たすか
(妥当性)を検証

成果物のメタモデル
(MOFクラス)
画面の
遷移
 必須(不要)属性
 必須(不要)関連
 空文字,null値
 オブジェクト参照
 etc
モデルの厳密な管理が可能に
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
10
依存関係の管理

成果物のメタモデル
(MOFクラス)
メタモデル設計者
モデル間の依存関係の管理が問題
1. 依存情報
 開発者が実際に作成したモデル間の関係
2. 依存関係定義
 依存情報を作成すべきモデル間の定義
instanceof
依存関係
開発者
開発者
?
モデル化
モデル化
記述仕様
画面の
遷移
モデル化
モデル化
記述仕様
画面の
遷移
Software Engineering Laboratory, Department of Computer Science,
記述仕様
記述仕様
依存関係
システム
依存情
定義 or 依
の構造
報
存情報
Graduate School of Information Science and Technology, Osaka University
11
依存関係定義
依存元の成果物
依存先の成果物
Rule
+
body: String
+sourceSelectRule
+targetSelectRule
+transformRule
成果物のメタモデ
ル(MOFクラス)
+
+sources
RefMofClass
1..*
qualifiedName: String +targets
TraceDef
+
成果物のメタモデ
ル(MOFクラス)
+subTrace
isAutomated: Boolean
1..*
source
instanceof
target
モデル(MOF
オブジェクト)
モデル(MOF
オブジェクト)
モデル化
モデル化
記述仕
様
画面の
遷移
記述仕様

依存関 
係の定義

モデル化
入力要素
記述仕
出力要素 様
システム
入力と出力の対応関係
の構造
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
12
依存情報の蓄積
依存元の成果物
Rule
+
body: String
+sourceSelectRule
+targetSelectRule
+transformRule
成果物のメタモデ
ル(MOFクラス)
+
+sources
RefMofClass
1..*
qualifiedName: String +targets
TraceDef
+
依存関係
定義
依存先の成果物
依存情報
+subTrace
isAutomated: Boolean
1..*
+sources
RefMofObject
+
refMofID: String
1..*
+targets
Trace
+
成果物のメタモデ
ル(MOFクラス)
+subTrace
refMofID: String
1..*
instanceof
定義の参照
モデル(MOF
オブジェクト)
モデル(MOF
オブジェクト)
target
source
モデル化
モデル化
 実際の入力要素
記述仕
様
 実際の出力要素
画面の
モデル化
記述仕様
記述仕
様
システム
の構造
依存情
 依存関係定義への参照
報
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
遷移
13
目次
MOF概要
 提案手法

メタモデルを用いた成果物の管理
メタモデルを用いた依存関係の管理
依存関係の定義
 依存情報の蓄積


支援システム
Strutsの画面遷移設計へ適用
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
14
Strutsを用いた画面遷移設計への適用

Strutsの画面遷移設計に適用
 設計成果物“画面遷移図”の管理
 実装成果物“struts-config.xml”の管理
 依存関係の管理

モデリング支援システムの試作
org.example.LogonForm
スタート画面
ログイン画面
/Logon
welcom.jsp
logon.jsp
LogonForm
success
/Logoff
/SubmitLogon
org.example.LogoffAction
画面遷移図
認証済み画面
failure
success
org.example.LogonAction
mainMenu.jsp
struts-config.xml
設計
実装
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
15
支援システムの試作(1/2)




UMLモデリングツールEnterpriseArchitectのアドイン
リポジトリの生成にはmediniを使用
開発言語:C#
LOC: 約7,000行(リポジトリ,リポジトリとの結合インタフェースを除く)
依存関係管理部
成果物管理部
画面遷移図
依存関係
定義
strutsconfig.xml
依存情報
蓄積
制御部
Enterprise Architect(モデリングツール)
2006/02/20
開発者
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
16
支援システムの試作(2/2)
メタモデル違反の検出
開発者はMOFオブジェクトを
 要求される依存オブジェクトの
使ってモデリングを行う
作成を強要
 依存情報の蓄積・更新
成果物のメタモデル違反や

画面遷移図からstrutsメタモデルに基づいて作成可能な
依存情報の不足・依存関係の
config.xmlへの部分的な自動
MOFオブジェクトのみを使用できる
矛盾をフィードバック
生成
 依存する他のオブジェクトへの
変更影響

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
17
まとめ

モデル駆動型ソフトウェア開発の基盤技術を目指して
 成果物とその依存関係をMOFメタモデル・MOFリポジトリのもとで
統一的に管理する新しい枠組みを提案

適用事例として
 Strutsの画面遷移設計に対して適用
 実際に動作するシステムとして実現可能であることを確認

今後の課題
 追加の評価実験(効率や規模)
 モデル変換などのさらに進んだ技術との統合
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
18
おわり
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
19
質疑

モデルと仕様とのギャップが,メタモデルと仕様とのギャップにすり替わった
だけでは?(藤本先生)



メタモデルを使うのは手間は増えても,チェックをするのが簡単になるか
らということ?(藤本先生)


言ってることは正しい
ただ,何も制限がない仕様-モデルよりも,いくらかでも制限されている仕様-メタモ
デルの方が断然いい
はい
UMLじゃあダメだけど,MOFならいいという「簡単な」例はないの?ダメ
な具体例が思いつかないようなら聞いてても納得できない(萩原先生)


書こうとしているものがそもそも違うような…
UMLクラスとMOFクラスでは目的が違うし,MOFの話は当然抽象的になる
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
20
依存関係
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
21
依存関係定義のためのメタモデル
成果物のメタモデル中で定義されたMOFクラス間のn対nの一方向依
存関係
 依存元となる要素群の選択方法や依存先となる要素群の選択方法,
自動化可能な場合の変換規則などはルールとして記述する
 定義したモデルは依存情報蓄積時に参照される

Rule
+
body: String
+sourceSelectRule
+targetSelectRule
+transformRule
<<instanceof>>
+sources
RefMofClass
+
1..*
qualifiedName: String +targets
TraceDef
+subTrace
Asub_X_Trace: Trace
Asub : RefElement
+
+
ref: = "ValueSpecification"
isAutomated: Boolean
+
ref: = "ForwardEdge"
X : RefElement
A_X_Trace: Trace
A : RefElement
+
detail: String
ValueSpecification.body → Forward.name
+
+
detail: String
ref: = "Forward"
B_XY_Trace: Trace
B : RefElement
1..*
+
ref: = "DisplayNode"
+ detail: String
DisplayNode.impl_file → Action.forward
DisplayNode.impl_file → Forward.path
C_Y_Trace: Trace
C : RefElement
+
ref: = "ActionNode"
+
Y : RefElement
detail: String
ActionNode.path
→ Action.path
ActionNode.impl_class → Action.type
+
ref: = "Action"
D_YZ_Trace: Trace
2006/02/20
D : RefElement
+
ref: = "ActionFormBean"
修士論文発表会
+ detail: String
ActionFormBean.name
→ FormBean.name
ActionFormBean.name
→ Action.name
ActionFormBean.impl_class → FormBean.type
ActionFormBean.scope
→ Action.scope
Z : RefElement
+
ref: = "FormBean"
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
22
依存情報蓄積のためのメタモデル
依存関係定義を参照し,実際に依存情報を蓄積
 RefMofObjectは実際に作成されたMOFオブジェク
トを参照
 Traceはその定義であるTraceDefを参照

+sources
RefMofObject
+
refMofID: String
1..*
+targets
Trace
+
+subTrace
refMofID: String
1..*
<<instanceof>>
Asub_X_Trace: Trace
Asub : RefElement
+
ref: = "ValueSpecification"
+
ref: = "ForwardEdge"
X : RefElement
A_X_Trace: Trace
A : RefElement
+
detail: String
ValueSpecification.body → Forward.name
+
+
detail: String
ref: = "Forward"
B_XY_Trace: Trace
2006/02/20
B : RefElement
+
ref: = "DisplayNode"
修士論文発表会
+ detail: String
DisplayNode.impl_file → Action.forward
DisplayNode.impl_file → Forward.path
C_Y_Trace: Trace
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
C : RefElement
+
ref: = "ActionNode"
+
detail: String
ActionNode.path
→ Action.path
ActionNode.impl_class → Action.type
Y : RefElement
+
ref: = "Action"
23
Struts
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
24
Strutsを用いた画面遷移設計への適用
画面遷移図
Rule
+
body: String
+sourceSelectRule
+targetSelectRule
+transformRule
+sources
RefMofClass
1..*
qualifiedName: String +targets
+
S t Va lu e S p e c ific a t ion
+
body: String
+guard
struts-config.xml
依存情報
+subTrace
TraceDef
+
依存関係
定義
isAutomated: Boolean
ScStrutsConfig
1..*
1
0..*
AssocEdgeValueSpecification
1
1
1
0..*
ScActionMappings
ScFormBeans
+edge
S t Nod e
+target
AssocTargetIncomming
1
+incomming
St E dg e
1
0..*
+source
+
+
S t Re q u e s t E d g e
S t S c re e n Nod e
+
+screenNode
+
+
+sources
impl_class: String [0..1]
path: String
c on s t ra in t s
{+source is DisplayNode}
{+target is ActionNode}
c on s t ra in t s
{+source is ActionNode}
RefMofObject
+
+requestEdge
0..1
AssocRequestEdgeInputData
0..1
AssocScreenNodeScreenDef
name: BeanName
type: ClassName [0..1]
S t F orwa rd E d g e
S t Ac t ion Nod e
impl_file: String
1
ScAction
ScFormBean
0..*
AssocSourceOutgoing
0..*
0..*
+outgoing
1
refMofID: String
1..*
+targets
Trace
+
+
+
+
+
+
path: RequestPath
type: ClassName [0..1]
name: BeanName [0..1]
forward: RequestPath [0..1]
scope: RequestScope
+subTrace
0..1
refMofID: String
0..*
1..*
ScForward
+inputData 1
+
+
S t In p u t Da t a
+screenDef 0..1
+
+
+
+
S t S c re e n De f
name: String
impl_class: String [0..1]
scope: String [0..1]
validation: Boolean [0..1]
name: String
path: RequestPath [0..1]
<<RefMofClass>>
Va lueSp ecifica ionRef
+
name: String = PackageScreenTr...
StValueSpecificaion.body = Forward.name
StScreenNode.impl_file or StActionNode.path
= Forward.path
<<RefMofClass>>
F orwa rd E d g eRef
+
<<RefMofClass>>
F orwa rd Ref
<<TraceDef>>
T ra ceF orwa rd
name: String = PackageScreenTr...
+
isAutomated: Boolean = True
+
name: String = PackageStrutsCo...
instanceof
<<RefMofClass>>
ScreenNod eRef
+
name: String = PackageScreenTr...
<<TraceDef>>
T ra ceAct ion
+
<<RefMofClass>>
Act ionNod eRef
+
name: String = PackageScreenTr...
isAutomated: Boolean = True
<<TraceDef>>
T ra ceBea n
<<RefMofClass>>
Inp ut Da t a Ref
+
name: String = PackageScreenTr...
<<RefMofClass>>
Act ionRef
+
name: String = PackageStrutsCo...
StScreenNode.impl_file = ScAction.forward
StActionNode.path = ScAction.path
StActionNode.impl_class = ScAction.type
StInputData.name = ScAction.name
StInputData.scope = ScAction.scope
+
isAutomated: Boolean = True
<<RefMofClass>>
F ormBea nRef
+
name: String = PackageStrutsCo...
InputData.name = FormBean.name
InputData.impl_class = FormBean.type
モデリングインターフェース
: StScreenNode
+
+
body: = "[failure]"
name: = "LogonForm"
impl_class: = "org.example.LogonForm"
scope: = "request"
+
+
: StRequestEdge
+target
: ScAction
: ScFormBean
+target
: StInputData
+
+
+
: ScActionMappings
: StValueSpecification
impl_file: = "logon.jsp"
+source
: ScStrutsConfig
: ScFormBeans
name: = "LogonForm"
type: = "org.example.LogonForm"
: StForwardEdge
path: = "/SubmitLogon"
type: = "org.example.LogonAction"
name: = "LogonForm"
scope: = "request"
+source
: StActionNode
+
+
+
+
+
+
: ScForward
path: = "/SubmitLogon"
impl_class: = "org.example.LogonAction"
+
+
name: = "success"
path: = "mainMenu.jsp"
: ScForward
+
+
name: = "failure"
path: = "logon.jsp"
+source
: StValueSpecification
: StForwardEdge
+
+target
2006/02/20
: StScreenNode
+
body: = "[success]"
開発者
開発者
修士論文発表会
impl_file: = "mainMenu.jsp"
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
25
(参考)画面遷移図のメタモデル・モデル例
S t Va lu e S p e c ific a t ion
+
body: String
S t Va lu e S p e c ific a t ion
+
body: String
+guard
+guard
<<meta-model>>
AssocEdgeValueSpecification
AssocEdgeValueSpecification
1
1
+edge
+target
S t Nod e
AssocTargetIncomming
1
+source S t Nod e
St E dg e
AssocTargetIncomming
0..*
+incomming
St E dg e
+outgoing
1
1
+edge
+incomming
+target
0..*
0..*
AssocSourceOutgoing
+source
+outgoing
<<instance
of>>
0..*
1
AssocSourceOutgoing
S t S c re e n Nod e
+
+screenNode
+
+
impl_class: String [0..1]
path: String
S t F orwa rd E d g e
c on s t ra in t s
{+source is DisplayNode}
{+target is ActionNode}
c on s t ra in t s
{+source is ActionNode}
+requestEdge
0..1
AssocRequestEdgeInputData
0..1
AssocScreenNodeScreenDef
+screenDef 0..1
impl_file: String
S t S c re e n De f
org.example.LogonForm
: StScreenNode
+
S t Re q u e s t E d g e
0..1
/Logon
logon.jsp
AssocScreenNodeScreenDef
+screenDef
LogonForm
/SubmitLogon
認証済み画面
success
2006/02/20
mainMenu.jsp
failure
S t F orwa rd E d g e
+target
+source
+requestEdge
0..1
: StActionNode
AssocRequestEdgeInputData
+ path: = "/SubmitLogon"
+inputData 1
+ impl_class: = "org.example.LogonAction"
S t In p u t Da t a+source
+
name: String
+
validation: Boolean
[0..1]
+target
+ impl_class: String
[0..1]
: StForwardEdge
<<model>>
+ scope: String [0..1]
: StScreenNode
org.example.LogonAction
body: = "[failure]"
+ String
name:[0..1]
= "LogonForm"
: StRequestEdge
: StForwardEdge
impl_class:
+ name: String
c on s t ra in t s
c on s t ra in t s
"org.example.LogonForm"
+
impl_class:
=
+
impl_class:
String
[0..1]
path: String
{+source
is
DisplayNode}
{+source is ActionNode}
+ scope: String [0..1]
+
scope:Boolean
= "request"
+ validation:
[0..1]
{+target is ActionNode}
0..1
S t S c re e n De f
+
+target
S t In p u t Da t a
+
+
ログイン画面
+screenNode
: StValueSpecification
impl_file: = "logon.jsp"
+source
+inputData 1
S t Ac t ion Nod e : StInputData
S t S c re e n Nod e
+
S t Re q u e s t E d g e
S t Ac t ion Nod e
impl_file: String
1
1
: StValueSpecification
+
body: = "[success]"
修士論文発表会
+ impl_file:
= and
"mainMenu.jsp"
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information
Science
Technology, Osaka University
26
(参考)struts-config.xmlのメタモデル・モデル例
ScStrutsConfig
0..*
1
1
0..*
ScActionMappings
ScFormBeans
1
1
0..*
0..*
ScAction
ScFormBean
+
+
<<meta-model>>
name: BeanName
type: ClassName [0..1]
+
+
+
+
+
path: RequestPath
type: ClassName [0..1]
name: BeanName [0..1]
forward: RequestPath [0..1]
scope: RequestScope
<<instance of>>
0..1
: ScStrutsConfig
0..*
ScForward
+
+
name: String
path: RequestPath [0..1]
: ScActionMappings
: ScFormBeans
: ScAction
: ScFormBean
+
+
name: = "LogonForm"
type: = "org.example.LogonForm"
<<model>>
2006/02/20
+
+
+
+
path: = "/SubmitLogon"
type: = "org.example.LogonAction"
name: = "LogonForm"
scope: = "request"
: ScForward
: ScForward
修士論文発表会
+ name: = "success"
+ name: = "failure"
Software Engineering Laboratory, Department of Computer Science, Graduate School of +
Information
and Technology,
Osaka
path: = Science
"mainMenu.jsp"
+ path:
= University
"logon.jsp"
27
(参考)画面遷移図,struts-config.xml間の依存関係定義
画面遷移図のメタモデル
要素への参照
struts-config.xmlの
メタモデル要素への参照
<<RefMofClass>>
Va lueSp ecifica ionRef
+
name: String = PackageScreenTr...
StValueSpecificaion.body = Forward.name
StScreenNode.impl_file or StActionNode.path
= Forward.path
<<RefMofClass>>
F orwa rd E d g eRef
+
<<RefMofClass>>
F orwa rd Ref
<<TraceDef>>
T ra ceF orwa rd
name: String = PackageScreenTr...
+
isAutomated: Boolean = True
+
name: String = PackageStrutsCo...
<<RefMofClass>>
ScreenNod eRef
+
name: String = PackageScreenTr...
<<TraceDef>>
T ra ceAct ion
+
<<RefMofClass>>
Act ionNod eRef
+
isAutomated: Boolean = True
<<RefMofClass>>
Act ionRef
+
name: String = PackageStrutsCo...
StScreenNode.impl_file = ScAction.forward
StActionNode.path = ScAction.path
StActionNode.impl_class = ScAction.type
2006/02/20
修士論文発表会
StInputData.name = ScAction.name
StInputData.scope = ScAction.scope
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
28
name: String = PackageScreenTr...
Strutsを用いた画面遷移設計への適用
依存関係
struts-config.xml
定義
依存情報
依存関係
 設計成果物“画面遷移図”の管理
struts-config.xml
ScStrutsConfig
定義
 実装成果物“struts-config.xml”の管理
画面遷移図のメタモデル のメタモデル
1
 依存関係の管理
1
0..*
0..*
画面遷移図
Strutsの画面遷移設計に適用
Rule
+
body: String
+sourceSelectRule
+targetSelectRule
+transformRule
+
RefMofClass
body: String
+
+guard
<<RefMofClass>>
Va lueSp ecifica ionRef
+sources
S t Va lu e S p e c ific a t ion
+subTrace
TraceDef
1..*
qualifiedName: String +targets
1
+
ScStrutsConfig
isAutomated: Boolean
1..*
+
AssocEdgeValueSpecification
1
name: String = PackageScreenTr...
1
1
0..*
0..*
ScActionMappings
ScFormBeans
+edge
AssocTargetIncomming
+target
S t Nod e
StValueSpecificaion.body
St Va
lu e Sp e c ific a t ion = Forward.name
StScreenNode.impl_file or StActionNode.path
1
+incomming
St E dg e
1
0..*
+source
0..*
AssocSourceOutgoing
+
S t S c re e n Nod e
+
+screenNode
+
+
impl_class: String [0..1]
path: String
S t F orwa rd E d g e
c on s t ra in t s
{+source is DisplayNode}
{+target is ActionNode}
c on s t ra in t s
{+source is ActionNode}
<<RefMofClass>>
F orwa rd E d g eRef
+requestEdge
0..1
AssocRequestEdgeInputData
0..1
AssocScreenNodeScreenDef
RefMofObject
+inputData 1
+
S t In p u t Da t a
+screenDef 0..1
+
+
+
+
S t S c re e n De f

S t Re q u e s t E d g e
S t Ac t ion Nod e
impl_file: String
name: String
impl_class: String [0..1]
scope: String [0..1]
validation: Boolean [0..1]
+
モデリング支援システムの実装
<<RefMofClass>>
Va lueSp ecifica ionRef
+
name: String = PackageScreenTr...
StValueSpecificaion.body = Forward.name
StScreenNode.impl_file or StActionNode.path
= Forward.path
<<RefMofClass>>
F orwa rd E d g eRef
+
<<RefMofClass>>
F orwa rd Ref
<<TraceDef>>
T ra ceF orwa rd
name: String = PackageScreenTr...
+
isAutomated: Boolean = True
+
+
<<TraceDef>>
T ra ceAct ion
<<RefMofClass>>
Act ionNod eRef
+
name: String = PackageScreenTr...
<<RefMofClass>>
Inp ut Da t a Ref
+
St Nod e
+
1
isAutomated: Boolean = True
+
0..*
name: String = PackageScreenTr...
1
<<TraceDef>>
T ra ceBea n
+
<<RefMofClass>>
F ormBea nRef
isAutomated: Boolean = True
+
+source
name: String = PackageStrutsCo...
1+
+
body: = "[failure]"
+target
+source
: StForwardEdge
welcom.jsp
+target
+source
+
body: = "[success]"
success
impl_file: = "mainMenu.jsp"
/Logoff
+
impl_file:
String
LogonForm
画面遷移図
org.example.LogonForm
スタート画面
ログイン画面
+screenDef 0..1
mainMenu.jsp
St Sc re e n De f
+
+
+
LogonForm
/SubmitLogon
認証済み画面
mainMenu.jsp
+outgoing
0..*
<<TraceDef>>
T ra ceAct ion
: ScStrutsConfig
<<RefMof
Act io
: ScActionMappings
: ScFormBeans
isAutomated: Boolean = True
: ScFormBean
0..1
+requestEdge
0..1
AssocRequestEdgeInputData
success
認証済み画面
AssocScreenNodeScreenDef
name: = "LogonForm"
type: = "org.example.LogonForm"
+
+
+
+
failure
success
org.example.LogonAction
+
: ScAction
name: String = Pa
path: = "/SubmitLogon"
type: = "org.example.LogonAction"
name: = "LogonForm"
scope: = "request"
name: = "success"
path: = "mainMenu.jsp"
: ScForward
+
+
name: = "failure"
path: = "logon.jsp"
ScForward
モデリングインターフェース
org.example.LogonAction +
: StScreenNode
+
: StValueSpecification
impl_file: = "logon.jsp"
+
body: = "[failure]"
+target
name: = "LogonForm"
impl_class: = "org.example.LogonForm"
scope: = "request"
設計
開発者
+
+
: StRequestEdge
+target
: StForwardEdge
+source
St In p u t Da t a
+
+
+
+
+
<<RefMofC
F ormBea
isAutomated: Boolean = True
: ScStrutsConfig
name: String
impl_class: String [0..1]
scope: String [0..1]
validation: Boolean [0..1]
+
+source
: StValueSpecification
name: String = Pac
struts-config.xml
name: String
path: RequestPath [0..1]InputData.name = FormBean.name
: ScActionMappings
: ScFormBeans
: ScAction
: ScFormBean
+
+
name: = "LogonForm"
type: = "org.example.LogonForm"
実装
+
+
+
+
path: = "/SubmitLogon"
type: = "org.example.LogonAction"
name: = "LogonForm"
scope: = "request"
InputData.impl_class = FormBean.type
: StActionNode
path: = "/SubmitLogon"
impl_class: = "org.example.LogonAction"
: StForwardEdge
name: String = PackageScreenTr...
+
+
<<TraceDef>>
T ra ceBea n
0..*
+inputData
1
<<RefMofClass>>
Inp ut Da t a Ref
+source
success
2006/02/20
0..*
instanceof
{+source is DisplayNode}
StInputData.scope
{+source=isScAction.scope
ActionNode}
{+target is ActionNode}
: StInputData
org.example.LogoffAction
St E d g e
0..*
+
+
0..1
logon.jsp
/Logoff
name: String = Package
1
+edge
+
failure
/SubmitLogon
/Logon
welcom.jsp
+
isAutomated: Boolean = True
メタモデルからリポジトリを生成
+screenNode
org.example.LogoffAction
+
+
<<RefMofClass
F orwa rd Ref
name: String
path: RequestPath [0..1]
: ScForward
+target
+
+
+
+
+
: StValueSpecification
: StScreenNode
<<RefMofClass>>
ScreenNod eRef
0..*
ScForward
<<TraceDef>>
T ra ceF orwa rd
+ path: RequestPath
+ type: ClassName [0..1]
<<RefMofClass>>
+ionNodname:
BeanName
St Re q u e[0..1]
s t Edg e
Act
eRef
St F orwa rd E d g e
StScreenNode.impl_file = ScAction.forward
St Ac t ion
Nod
e
+ = PackageScreenTr...
forward: RequestPath [0..1]
StActionNode.path = ScAction.path
+ name: String
StActionNode.impl_class = ScAction.type
impl_class: String
c on s t ra in t s StInputData.name
+ [0..1] scope: RequestScope
c on=sScAction.name
t ra in t s
path: String
St Sc re e n Nod e
+source
: StForwardEdge
+
+ /Logonname: BeanName
logon.jsp
+ type: ClassName
[0..1]
path: = "/SubmitLogon"
impl_class: = "org.example.LogonAction"
path: RequestPath
type: ClassName [0..1]
name: BeanName [0..1]
forward: RequestPath [0..1]
scope: RequestScope
+incomming
1
ScAction
: StActionNode
+
+
+
+
+
+
+
name: BeanName
type: ClassName [0..1]
AssocEdgeValueSpecification
ScActionMappings
AssocSourceOutgoing
: StValueSpecification
: StRequestEdge
1
refMofID: String
name: String = PackageScreenTr...
ScFormBean
ログイン画面
スタート画面
: StInputData
name: = "LogonForm"
impl_class: = "org.example.LogonForm"
scope: = "request"
+guard
+subTrace
Trace
+
name: String = PackageStrutsCo...
StScreenNode.impl_file = ScAction.forward
StActionNode.path = ScAction.path
StActionNode.impl_class = ScAction.type
StInputData.name = ScAction.name
StInputData.scope = ScAction.scope
org.example.LogonForm
impl_file: = "logon.jsp"
1..*
+targets
AssocTargetIncomming
+target
<<RefMofClass>>
Act ionRef
InputData.name = FormBean.name
InputData.impl_class = FormBean.type
+
body: String
name: String = PackageStrutsCo...
name: String = PackageScreenTr...
+
+
0..1
+sources
name: String = PackageScreenTr...
<<RefMofClass>>
ScreenNod eRef
+
+
+
refMofID: String
ScAction
ScFormBean
= Forward.path
1..*
ScFormBeans
: StScreenNode
1
0..*
0..*
+outgoing
1
開発者
+
+
: ScForward
name: = "success"
path: = "mainMenu.jsp"
: ScForward
+
+
修士論文発表会
name: = "failure"
path: = "logon.jsp"
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
+
+target
: StScreenNode
body: = "[success]"
29
没
2006/02/20
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
30
モデルの更新

MOFオブジェクトの追加,修正,削除
 オブジェクト自身の更新(追加)
 自身の更新+関連のあるオブジェクトの更新(修正)
 関連のあるオブジェクトの更新(削除)

<<‰ æ
– Ê
>>
ƒ w
ƒ b
ƒ _
属性の追加,修正,削除
+
+s ourc e
 属性をもつMOFオブジェクトの更新

関連の追加,修正,削除
impl_file: St ring = / c ommon/ Inc lude...
<<“ ü
— ̓ p
ƒ ‰
ƒ ƒ
[ ^>>
ƒ 
† [ƒ U
ƒ A
ƒ J
ƒ E
ƒ ƒ
“g
+
+
+
+
+out going
+reques
t Edge
+input
Dat a
impl_c las s : St ring
name: St ring = ac c ount Bean
s c ope: St ring = s es s ion
v alidat ion: Boolean = F als e
<<ƒ Š
ƒ N
ƒ G
ƒ X
ƒg
>>
C la s s 1
+inc omming
+t arget
 両端のMOFオブジェクトの更新
<<ƒ A
ƒ N
ƒ ƒ
V‡
ƒ “>>
ƒ T
ƒ C
ƒ “
ƒ ƒ
C “
+
+
impl_c las s : St ring
pat h: St ring = / s hop/ s igonF orm
+s ourc e
+out going
いずれの場合もオブジェクトの更新に帰着される
+
2006/02/20
<<‘ ˆJ Ú
 ð
Œ
>>
C la s s 3
body : St ring = s uc c es s
+edge
+guard
<<‘ J
ˆ Ú
>>
C la s s 2
+inc omming
+t arget
修士論文発表会
<<‰ æ
– >
Ê>
ƒ O

ƒ C
ƒ “
‰æ
– Ê
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka ƒUniversity
31
提案手法の概要
org.example.LogonForm
スタート画面
ログイン画面
/Logon
welcom.jsp
logon.jsp
LogonForm
success
/Logoff
/SubmitLogon
org.example.LogoffAction
認証済み画面
mainMenu.jsp
failure
success
org.example.LogonAction
MOF
<<instanceof>>
メタモデル設計者
メタモデル設計者
Source Metamodel
TraceDef Metamodel
Target Metamodel
target
source
メタモデル設計者
Trace Metamodel
<<instanceof>>
<<instanceof>>
TraceDef Model
definition
開発者
Trace Model
開発者
Source Model
Target Model
source
2006/02/20
target
修士論文発表会
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
32
成果物の管理(1/2)

成果物のメタモデル
(MOFクラス)
仕様とモデルのギャップが問題
 成果物の仕様をメタモデルとして形式的
メタモデル設計者
リポジトリ生成
に定める
 開発者にメタモデルのインスタンスとして
モデルを作成させる
instanceof
依存関係
モデル(MOF
オブジェクト)
開発者
開発者
モデル化
記述仕様
画面の
遷移
仕様と
モデルの
ギャップ
記述仕様
モデル化
モデル化
画面の
遷移
記述仕様
システム
の構造
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
33
依存関係の管理

成果物のメタモデル
(MOFクラス)
メタモデル設計者
依存関係の管理が問題
1. 依存情報
 開発者が実際に作成した成果物間の関係
2. 依存関係の定義
 開発者が作成する成果物の仕様間の関係
instanceof
依存関係
開発者
開発者
モデル化
記述仕様
画面の
遷移
仕様と
モデルの
ギャップ
記述仕様
画面の
遷移
?
モデル化
モデル化
記述仕様
依存関
依存情
係の定義
報
モデル化
記述仕様
システム
の構造
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
34