PhD studentship admittance examination June 21, 2004...
Transcript of PhD studentship admittance examination June 21, 2004...
On Metamodelling
PhD studentship admittance examinationJune 21, 2004
Frédéric Fondement
June 21, 2004© F. Fondement - 2 -
Contents
Software engineering
Modelling
Metamodelling
A case study
Concluding remarks
June 21, 2004© F. Fondement - 3 -
Contents
Software engineering• Productivity gains• Production gains• Major lessons
Modelling
Metamodelling
A case study
Concluding remarks
June 21, 2004© F. Fondement - 4 -
Productivity Gains in SE
Methodologies• SADT• Fusion• OMT• Booch• Catalysis• RUP• Fondue• SEAM• …
Abstraction Techniques
• Punched Cards• Assembly Code• Functional / Procedural
Programming• Object-Oriented
Programming• Patterns• Concurrent Programming• Component-Oriented
Programming / Middleware• Design by Contracts• Aspect-Oriented
Programming• Product Family Engineering• …
June 21, 2004© F. Fondement - 5 -
Consequence: Production GainsComplexity
(LOC)
104
105
106
107
108
Age1965 1975 1985 1995 2005
Compilers
Packet SwitchingSystem
Nuclear SubmarineControl
GSM Networks
Windows 20001963: COBOL1959: ALGOL
1972: SmallTalk
1983: ADA 83
1994: GOF
1992: Design By Contracts
FunctionnalProcedural
OO Components
1992: Catalysis1976: SADT
1997: AOP
1991: CORBA
1993: Booch 93
Remark: A new paradigm needs around 10 years to be mature
June 21, 2004© F. Fondement - 6 -
Major Lessons
SE Best Practices• Reuse / Develop for reuse• Refinement / Refactoring• Prototyping• Test / Verification• Communication / Documentation
Problems• Requirements change
• Nokia: 50% changed after finalization ; 60% of them at least twice• Platforms change
• OS, Languages, Databases, Middleware, …• Development technology change
• Compilers, Code generators, Frameworks, …• People change
• Especially for systems developed 30 years ago !
June 21, 2004© F. Fondement - 7 -
Contents
Software engineering
Modelling• Models• Refinements• Each step• Questions raised
Metamodelling
A case study
Concluding remarks
June 21, 2004© F. Fondement - 8 -
Models
Abstract away details• Use paradigms rather than technologies• Enhance productivity and production !
Human friendly• Different views of the same system
Cheap to manipulate and maintainModels at any abstraction level
• Use cases, Business models, SDL, CCM, B, …
Used most of the time forDocumentation / communicationAnalysisPrototyping
Often drawings out of sync with (code) reality !
June 21, 2004© F. Fondement - 9 -
SE with Model Refinements
Model Driven Engineering (MDE)“From contemplative to productive”
SystemSystemSystem
Code
Refin
emen
ts /
Refa
ctor
ings
SystemSystem
Code Generation PlatformSpecificity
Abstraction
June 21, 2004© F. Fondement - 10 -
MDE Step
SystemSystem
Prototype
Test CasesProof
Documentation
June 21, 2004© F. Fondement - 11 -
Questions Raised
SystemSystemSystem
Code
SystemSystem
Code Generation
What language for describing systems ?
• E.g. E-Banking• From Use Cases…• …to Oracle Schema + EJB
+ JSP• E.g. Subway
• From Use Cases…• … to Wireless JavaCard
• …One unique language is not enough !
• Domain Specific Languages• Define YOURSELF the right
level of abstraction !
Refin
emen
ts /
Refa
ctor
ings
June 21, 2004© F. Fondement - 12 -
Contents
Software engineering
Modelling
Metamodelling• Principles• A Standard : the MOF• MOF layers
A case study
Concluding remarks
June 21, 2004© F. Fondement - 13 -
Metamodel
Abstract Syntax for• Models• Domain Specific Languages
Metamodelling Language• Needs an Abstract Syntax (Metametamodel)• A Metametamodel is a Language
• Should be possible to describe it by itself !
Remark: for a CASE tool, data are models• UML, Music Scores, Equipment of Industrial Systems, …• Communication among CASE tools with models
• Requires knowledge of the surrounding metamodel• Metamodels structure model repositories as database schemas
structure databases
DTD
XML
«conform»
Modelling TS
«conform»
MyModel
<<metamodel>>
MM
XM
L TS
June 21, 2004© F. Fondement - 14 -
The MOFledoMtnemelE
ecapsemaN
elbazilareneGtnemelE
erutaeF
depyTtnemelE
reifissalC
epyTataD
laruoivaheBerutaeF
larutcurtSerutaeF
tropmI
egakcaP
ssalCnoitaicossA
gaT tniartsnoC
retemaraPerutcurtSdleiF
tnatsnoC
ecnerefeRnoitpecxE
noitaicossAdnE
etubirttAnoitarepO
erutcurtSepyT
noitaremunEepyT
noitcelloCepyT
evitimirPepyT
nOsdnepeD/
sezilareneG
sniatnoC
sesailA
esiaRnaC
epyTfOsI
oTsehcattA
sniartsnoC
oTsrefeRsesopxE/
*..0
*..0
*..0deredro
*..0
*..0*..0
*..0
*..0
1
*..1
*..0
*..1
*..0
*..0
1
*..0
*..0
1
*..0*..0deredro
deredro
deredro
epyTsailA
June 21, 2004© F. Fondement - 15 -
MOF : Layers
Let’s take a simple example of metamodel
SystemSystemSystem
Code
SystemSystem
Code Generation
«conforms»«metamodel»DataBaseMM
Table
NamedElement
name : stringname : string
DataBaseA_table_dataBase
table
0..1 *
dataBase Column
isPrimaryKey : boolean
TypedElement
DataType
Element
isPrimaryKey : boolean*
column
A_column_table0..1
table
typedElement
A_type_typedElement
0..1 type
*
June 21, 2004© F. Fondement - 16 -
MOF : LayersMOF Metametamodel
M3
M2
Table
NamedElement
name : stringname : string
DataBase
A_table_dataBase
table
0..1 *
dataBase Column
isPrimaryKey : boolean
TypedElement
DataType
Element
isPrimaryKey : boolean*
column
A_column_table0..1
table
typedElement
A_type_typedElement
0..1 type
*
Metamodel
Teams
PK name
Match
PK,FK1 Team1PK,FK2 Team2PK PlacePK Date
Score1Score2
ModelM1
Real LifeName
FranceSwitzerlandGermany
M0
June 21, 2004© F. Fondement - 17 -
MOF : Layers
Teams
PK name
Match
PK,FK1 Team1PK,FK2 Team2PK PlacePK Date
Score1Score2
MOF Metametamodel
M3
M2
Table
NamedElement
name : stringname : string
DataBase
A_table_dataBase
table
0..1 *
dataBase Column
isPrimaryKey : boolean
TypedElement
DataType
Element
isPrimaryKey : boolean*
column
A_column_table0..1
table
typedElement
A_type_typedElement
0..1 type
*
Metamodel
SystemSystemSystem
Code
SystemSystem
Code Generation
ModelM1
“Real” LifeName
FranceSwitzerlandGermany
M0
June 21, 2004© F. Fondement - 18 -
Teams
PK name
Match
PK,FK1 Team1PK,FK2 Team2PK PlacePK Date
Score1Score2
:Class
name=NamedElement
:Class
name=Table
:AssociationEnd
container
name=Table
supertype
Generalizes
type
contents
container
:Class
name=DataBase
:Association
name=A_table_dataBase
:AssociationEnd
name=NamedElement
name=A_table_dataBase
subtype
contents
container
Contents
name=DataBasetype
IsOfType
subtype
supertype
Generalizes
Contents
:Class
name=Element
:Attribute
name=name
String:DataType
name=name
Contents
contents
IsOfTypetype
Generalizes
subtype
name=Elementsupertype
IsOfType
M3 objects…
MOF
M3
M2
M1
ModelElement
name : string
Table
NamedElement
name : stringname : string
DataBase
A_table_dataBase
table
0..1 *
dataBase Column
isPrimaryKey : boolean
TypedElement
DataType
Element
isPrimaryKey : boolean*
column
A_column_table0..1
table
typedElement
A_type_typedElement
0..1 type
*
Instance Of
MOF : Layers
June 21, 2004© F. Fondement - 19 -
Teams
PK name
Match
PK,FK1 Team1PK,FK2 Team2PK PlacePK Date
Score1Score2
M3 objects… represent a M2 model !
MOF
M3
M2
M1
ModelElement
name : string
Table
NamedElement
name : stringname : string
DataBase
A_table_dataBase
table
0..1 *
dataBase Column
isPrimaryKey : boolean
TypedElement
DataType
Element
isPrimaryKey : boolean*
column
A_column_table0..1
table
typedElement
A_type_typedElement
0..1 type
*
Instance OfMeta Objects
:Class
name=NamedElement
:Class
name=Table
:AssociationEnd
container
name=Table
supertype
Generalizes
type
contents
container
:Class
name=DataBase
:Association
name=A_table_dataBase
:AssociationEnd
name=NamedElement
name=A_table_dataBase
subtype
contents
container
Contents
name=DataBasetype
IsOfType
subtype
supertype
Generalizes
Contents
:Class
name=Element
:Attribute
name=name
String:DataType
name=name
Contents
contents
IsOfTypetype
Generalizes
subtype
name=Elementsupertype
IsOfType
MOF : Layers
June 21, 2004© F. Fondement - 20 -
Teams
PK name
Match
PK,FK1 Team1PK,FK2 Team2PK PlacePK Date
Score1Score2
:Class
name=NamedElement
:Class
name=Table
:AssociationEnd
container
name=Table
supertype
Generalizes
type
contents
container
:Class
name=DataBase
:Association
name=A_table_dataBase
:AssociationEnd
name=NamedElement
name=A_table_dataBase
subtype
contents
container
Contents
name=DataBasetype
IsOfType
subtype
supertype
Generalizes
Contents
:Class
name=Element
:Attribute
name=name
String:DataType
name=name
Contents
contents
IsOfTypetype
Generalizes
subtype
name=Elementsupertype
IsOfType
M<X> objects… represent a M<X-1> model !
MOF
M3
M2
M1
ModelElement
name : string
Table
NamedElement
name : stringname : string
DataBase
A_table_dataBase
table
0..1 *
dataBase Column
isPrimaryKey : boolean
TypedElement
DataType
Element
isPrimaryKey : boolean*
column
A_column_table0..1
table
typedElement
A_type_typedElement
0..1 type
*
Instance OfMeta Objects
dataBase
dataBase
A_table_dataBase
Championship:DataBase
name=Championshipname=Championship
Teams:Table
name=Teams
name:Column
isPrimaryKey=truename=name
Match:Table
name=MatchTeam1:Column
isPrimaryKey=truename=Team1isPrimaryKey=true
name=TeamsisPrimaryKey=truename=nametable column
A_column_table
name=Match
table
table
A_table_dataBase
name=Team1
type
typedElementA_type_typedElement
A_column_table
table column
MOF : Layers
June 21, 2004© F. Fondement - 21 -
Contents
Software engineering
Modelling
Metamodelling
A case study
Concluding remarks
June 21, 2004© F. Fondement - 22 -
Step 1 : Use-Cases
Modelling a Genealogy website.
1st: Requirement elicitation• I want a web application that shows me the family of somebody
• Wife• Husband• Daughters• Sons
• The Web application must let me enter family information
• Could be captured more precisely in Use Cases and Sequence Diagrams…
SystemSystemSystem
Code
SystemSystem
Code Generation
June 21, 2004© F. Fondement - 23 -
SystemSystemSystem
Code
SystemSystem
Code Generation
Step 2 : Domain
Modelling a Genealogy website.
2nd: Business Model• A class diagram
• Metamodel : UML core
nosreP
emangnirtScilbupemanrusgnirtScilbuprednegredneGcilbup
)nosrepnosreP(yrramegairraMcilbupegairraM
etadetaDcilbup
redneG
elamgnirtScilbupelamefgnirtScilbup
>>noitaremune<<
*..0
nerdlihc
2
stnerap
1..0
dnabsuh
1..0
efiw
June 21, 2004© F. Fondement - 24 -
Step 3 : Cinematic
Modelling a Genealogy website.
3rd: Web site cinematic…• A DSL : Netsilon Hypertext
SystemSystemSystem
Code
SystemSystem
Code Generation
June 21, 2004© F. Fondement - 25 -
What is that new Model ?
Web File
CollectionDisplayer
ValueDisplayer
Link
DefaultDecision
SystemSystemSystem
Code
SystemSystem
Code GenerationM1
M0
June 21, 2004© F. Fondement - 26 -
Cinematic : Metamodel
Netsilon Hypertext Metamodel
WebElement
DecisionCenter
CollectionDisplayer Linker ValueDisplayer
WebFile
ModelElement
DecisionConstraint
DefaultDecisionConstraint
0..1 *
0..1*
*
1
M2
June 21, 2004© F. Fondement - 27 -
Step 4: Data Management
Modelling a Genealogy website.
4th: Generate data management part of the web application
• Automatic model transformation from the business model to web application hypertext model
• Class Diagram -> Hypertext Model
nosreP
emangnirtScilbupemanrusgnirtScilbuprednegredneGcilbup
)nosrepnosreP(yrramegairraMcilbupegairraM
etadetaDcilbup
redneG
elamgnirtScilbupelamefgnirtScilbup
>>noitaremune<<
*..0
nerdlihc
2
stnerap
1..0
dnabsuh
1..0
efiw
SystemSystemSystem
Code
SystemSystem
Code Generation
June 21, 2004© F. Fondement - 28 -
Lasts steps : Platforms
Modelling a Genealogy website.
5th: Choose platforms…• Now and only now !• JSP / MySQL• Generate code• Not much to develop here but automatable optimizations…
6th: Deploy !• On server www.genealogy.com/family• On database server.genealogy.com named Family
SystemSystemSystem
Code
SystemSystem
Code Generation
June 21, 2004© F. Fondement - 29 -
SystemSystemSystem
Code
SystemSystem
Code Generation
After : Maintenance
Modelling a Genealogy website.
7th A: Maintain !• The application is victim of its success• Platform have to be changed !• Servlet / Oracle• Repeat phases
• 5 : “Choose platform and generate code”• 6 : “Deploy”• (needs data migration)
June 21, 2004© F. Fondement - 30 -
SystemSystemSystem
Code
SystemSystem
Code Generation
After : Maintenance
Modelling a Genealogy website.
7th B: Maintain !• A new requirement appeared !• Visibility restricted to one’s own family• Redesign appropriate phases
• Guided by the upper layer• Regenerate / Redeploy automatically
June 21, 2004© F. Fondement - 31 -
After : Maintenance
Modelling a Genealogy website.
7th C: Maintain !• Your system must interoperate with other systems !• Remote calls from CORBA• Select a new platform (CORBA)• Regenerate / Redeploy automatically
SystemSystemSystem
Code
SystemSystem
Code Generation
June 21, 2004© F. Fondement - 32 -
Contents
Software engineering
Modelling
Metamodelling
A case study
Concluding remarks• Who is involved• What is Metamodelling• What is NOT Metamodelling
June 21, 2004© F. Fondement - 33 -
Who is Involved ?
Actors• Domain specialists• SE Method developers• NOT system developers
Developed once, often used• There are much more programs than languages !
June 21, 2004© F. Fondement - 34 -
What is Metamodelling
Make models machine friendly beside human friendly• Enables tool interoperability at model level• A first step for automating (at least partially) incremental and
reactive refinements
Define an ontology for a class of models• Vocabulary (terms)• Taxonomy (relations between terms)• Notation (model depicting)• Epistemology (what is represented) + Semantics• Can define extension mechanisms (profiles)
June 21, 2004© F. Fondement - 35 -
Needs More Maturity
Make models machine friendly beside human friendly• Enables tool interoperability at model level• A first step for automating (at least partially) incremental and
reactive refinements
Define an ontology for a class of models• Vocabulary (terms)• Taxonomy (relations between terms)• Notation (model depicting)• Epistemology (what is represented) + Semantics• Can define extension mechanisms (profiles)
Unfortunately, standards are not going that far…at the moment !
June 21, 2004© F. Fondement - 36 -
What is Not Metamodelling
Defining relationship among models• Model Transformation
• Bidirectional• Traceable• Defined on metamodels
• Code• Generation• Reverse• May be linked to Concrete Syntax definition
– E.g. there are metamodels for Java
June 21, 2004© F. Fondement - 37 -
Thank you for your attention !
Any question ?
June 21, 2004© F. Fondement - 38 -
Annexes
Variability
A Typical Variability Example
The Fondue Toolset Architecture
MOF Model Interchange
Ontology Overview
June 21, 2004© F. Fondement - 39 -
Software Lifecycle and VariabilityRequirement
elicitationNokia:
50% changes after “frozen”60% of these changes at least twice
Analysis / DesignImplementation Compilers
Frameworks
Verification / TestDeployment Middleware
DatabasesApplication serverHardware
Maintenance During years (e.g. bank and insurance companies)
TurnoverPrevious variabilities
June 21, 2004© F. Fondement - 40 -
Typical Example
OS/390
Hard to reuseHard to reverseHard to maintain
PACBASE
DB2
Web Browser
Internet
Bank
J2EE
AppletE-Banking
June 21, 2004© F. Fondement - 41 -
Fondue Builder Architecture Overview
FONDUEANIMATOR
FONDUEREPOSITORY
(JMI Repository)
OBJECTS EDITORFONDUE EDITOR
XMI File
IMPORTEXPORT
XMI SERIALIZER
FONDUECERTIFIER
June 21, 2004© F. Fondement - 42 -
MOF : Model interchange (XMI)Model interchange is standardizedShould take into account models of any kinds (of any metamodel)XMI is XML => it needs a schemaSchema is given by the M(X+1) level !
• Tools generate a DTD from a metamodel• Tools load / store models from / to XMI• An “XMI model” is valid for a given metamodel
• XMI is a language template
Remark• 3 versions of XMI (1.0, 1.1, 1.2)• Many versions of metamodel (UML : 0.9, 1.0, 1.3, 1.4, 2.0…)• Tools interpret the XMI standard as they wish !• XMI possibilities for a same model (of a given metamodel) : Cartesian
product of• XMI version• Metamodel version• Tool
DTD
XMI
«conforms to»«instanciate»
Modeling TS
MyModel
<<metamodel>>
MM
XM
L TS
June 21, 2004© F. Fondement - 43 -
Ontology Overview
Describes• Vocabulary: set of terms• Taxonomy: relationships between terms (parent / child, …)• Thesaurus: equivalences between terms
Usages – Jasper R. and Uschold M.• Neural authoring: knowledge of an expert system• Specification: core of a tool (Poseidon, Fondue Toolset, …)• Common access to information: interoperability (tools, DBs, …)• Ontology-Based Search: data mining (Semantic Web, …)
Layers• L0: Objects described by an ontology• L1: The ontology itself• L2: The language for describing ontology (OWL, IDL, KAON, …)
June 21, 2004© F. Fondement - 44 -
Ontology Overview
L2 L2-L1 L2-L1-L0M3
M2
M1
M0
L2
L1
L0
L1
L0
L0
Data Management(semantic web,
warehousing,…)
Modelling(metamodelling)
TheMetamodelling
ontology
TheMetametamodelling
ontology