web technologies: model driven engineering
DESCRIPTION
TRANSCRIPT
Web Technologies
Introduction to Model Driven Engineering
Piero [email protected]
Skype: pierofraternali
Models: a meeting place for developers & users
Motivations
• “Supply of talented IT staffers isn't keeping up with demand. And it won't change anytime soon.” – Eric Chabrow, in The
New IT Worker Shortage, CIOInsight 2009
#programmers
#applications
2005 2010 2015 2020
From crafting to fabrication
• Engineering addresses the optimization of production by means of abstraction and standardization
• Products are modeled, verified, and produced using standard models and methods
Models
• A model is an ABSTRACT REPRESENTATION of a product, service or system that allows us to investigate, verify, and document its properties BEFORE production
Software as an engineering product
• SW is an engineering product
• BUT:– It can be changed easily,
even after delivery and during usage
– It is produced in short time and at low cost
– It must satisfy a broad spectrum of requisities, hard to quantify
• SO engineering practices are not always applied
Software Models
• Software Engineering has a long tradition on the use of abstraction and software models
• MODEL DRIVEN ENGINEERING• SOFTWARE MODELS are
– An abstract representation of a system, independent of technology
– A tool for expressing and verifying requirements– A starting point for automatically generating the
code
History
• Software models are as old as software
• Flow diagrams were the first tool for describing software
• Programming language and models evolved together– Imperative programming –
flow diagrams– Info systems – ER– OO systems – object models
Milestones
P.- ChenThe Entity-Relationship Model-Toward a Unified View of DataTODS 1976
D. Harel, "Statecharts: A Visual Formalism for Complex Systems", (1987)
Outlook (by Gartner 2010)
• Key Findings in MDE– The complexity of new, service-oriented
architectures (SOAs) and business process management (BPM) demand more-abstracted, model-driven approaches.
– Business and IT modeling standards and technologies are converging.
– The differences between design time and runtime technologies are disappearing
Modeling convergence
Outlook (by Gartner 2010)
• Recommendations– Ensure collaboration among the IT organization,
business process architects and the analysts who are using these models;
– Use multiple methodologies and approaches to Application Development — especially those that leverage modeling efforts, agile methods, and reusable design patterns and frameworks to improve productivity, while ensuring quality and performance.
– Implement the role of application architect to promote reusable software and data services.
Economic Value (BPM)
MDA: The Modern Age of MDE
• Object Management Group (OMG) unified several modeling languages into a coherent proposal (MDA= Model Driven Architecture) setting the stage for a convergence of architecture, languages, notations, and tools
• UML is the most popular ingredient of MDA but not the only one
MDD, MDA, MDE
MODEL DRIVEN
ARCHITECTURE
MODEL DRIVEN DEVELOPMENT
MODEL DRIVEN ENGINEERING
MODEL DRIVEN TESTING
MODEL DRIVEN COST ESTIMATION
MODEL SEARCH
History
• 1989: OMG formed to create a standard for distributed object systems
• 1991: Corba 1.0 specification released• 1996: OMG includes modeling as a focus• 1997: UML adopted by OMG• 2001: OMG adopts MDA• 2005: UML 2.0 adopted by OMG• 2006: BPMN standard adopted by OMG• 2009: BPMN 2.0 beta 1
OMG MDA standards
• OMG Standards– Modeling – UML– Metamodeling – MOF– Action semantics– Model interchange – XMI– Human-usable textual notation – HUTN– Model-based testing and debugging– Domain-specific UML profiles
MDA core concepts
• System = the subject: a program, a single computer system, some combination of parts of different systems, a federation of systems, each under separate control, people, an enterprise, a federation of enterprises…
• Problem space (Domain): the context where the system operates
• Solution Space: the spectrum of possible solutions that satisfy the system requirements
• Model: a (partial or total, abstract or concrete) representation of the system and its environment
MDA core concepts
• Architecture = specification of the parts and connectors of the system and the rules for the interactions of the parts using the connectors
• Viewpoint: description of a system that focuses on particular concerns
• View: a model of a system under a specific viewpoint
• Transformation: the conversion of a model into another model
MDA core concepts
• Platform: set of subsystems and technologies that provide a coherent set of functionality through interfaces and specified usage patterns (e.g., JEE, .NET)
• Platform Model: a set of technical concepts, representing the different parts that make up a platform and the services provided by that platform
Development
• In MDA development is a chain of transformations from model to model, until enough “concreteness” is incorporated to make the model “executable”
How are models specified
• M0: a concrete system, your application
• M1: the model of your system
• M2: the concepts used to represent your models (e.g., UML or BPMN metamodels)
• M3: the formalism that dicates the rules for defining modeling languages (e.g., UML metamodel expressed in Meta Objet Format-MOF)
M3: meta-meta-model
M2: meta-model
M1: model
M0: system
describes
describes
describes
describes
Example
Customer_table Order_table
customer order
system
model
metamodel
Why meta-models
• Allow a syntactically precise definition of modeling languages
• Can be read by tools, enable portability, model parsing (syntactic) checking
• Like grammars for textual languages and ontologies for semantic languages
The WebML metamodel(fragment)
Classes of models (viewpoints)
• Computation Independent Models: represent the business view of the system
• Platform Independent Models: represents the system abstracting from technology
• Platform Specific Models: represents the system considering technology
CIM
PIM
PSM
mapping
mapping
CIM: examples
• Business Process Modeling Notation: – BPMN provides a
Business Process Diagram (BPD), which is a Diagram designed for use by the people who design and manage business processes.
PIM: examples• Production Rule Representation
(PRR)– a standard production rule
representation that is compatible with rule engine vendors' definitions of production rules
• Product Lifecycle Management Services (PLM)
– a PIM for Product Lifecycle Management Services derived from the ISO 10303-214 STEP model
• Gene Expression (GENE)– representation of gene expression data
and relevant annotations, as well as mechanisms for exchanging these data
• General Ledger (LEDG)– interfaces and their semantics to
enable interoperability between General Ledger systems and accounting applications
Model Transformations
• The application of mapping rules and knowledge to a source model to obtain a target model
• Can use different styles, based on how the mapping rules are specified
Source model
Target model
Additional information
DesignPatterns
Transformation
In this Course
• Business process
Modeling Notation
(BPMN 2.0)
• Web Modeling
Language (WebML)
• Java enterprise
Edition (JEE)
CIM
PIM
PSM
mapping
mapping
Domain Specific Languages (DSL)
• DSL: a language for describing systems in a specific domain (Web apps, embedded systems, etc)
• General Purpose Language: a language for describing systems in multiple domains (e.g., UML)
MDA and DSL
• MDA offers two standard ways to define DSLs
• Stereotyping: UML 2.0 elements are overloaded with domain specific meaning
• Metamodelling: new language constructs are defined
GPL vs DSL
• GPL– (Often) Standard– Portable across tools– More complex– Less intuitive to learn– Lack of precise semantics– Harder to use for code
generation
• DSL– Easier to learn for domain
experts– More precise semantics,
better checking– More amenable to
optimized code generation– Narrower scope– Non standard– Less portable across tools
GPL: UML
• A concrete syntax for specifying any kind of system
• Customizable with extension mechanism (family of languages: Real-Time UML, UML for EDOC..)
• Supported by tools
UML structure
UML INFRASTRUCTURE
MOF
PR
OF
ILES
OCL
ST
AT
E
MA
CH
INE
S
CLA
SS
ES
& C
OM
PO
NE
NT
S
AC
TIV
ITIE
S
INT
ER
AC
TIO
NS
AC
TIO
NS
FLO
WS
BASIC UML
Basic level
Intermediate level
Complete level
DSL: forms
DSL: examples
DSL Application Domain
BNF (1950! ) Syntax Specification
HTML Hypertext Web Pages
MATLAB Technical Computing
SQL Database Queries
LaTex Text processing
Marjan Mernik, University of Maribor
Jan Heering, CWI
Anthony M. Sloane, Macquarie University
ACM Computing Surveys, Vol 37, No. 4
Executability of DSL
• Well-defined execution semantics – HTML
• Input language of an application generator– WebML: Web/SOA modeling– Application generator compiles the DSL into a GPL (Java)– More declarative, well-defined execution semantics
(StateCharts)• Not executable but useful for application generation
– BNF: purely declarative, but can be an input language for a parser generator
• DSL not meant to be executable– Domain-specific data structure representations– Benefit from editors, analyzers, consistency checkers
Language levels (Caper Jones)
Language Level Relationship to Productivity
LANGUAGE LEVEL PRODUCTIVITY AVERAGE PER STAFF MONTH -------------------------- ------------------------------------------------------------------ 1 - 3 5 to 10 Function Points 4 - 8 10 to 20 Function Points 9 - 15 16 to 23 Function Points 16 - 23 15 to 30 Function Points 24 - 55 30 to 50 Function PointsAbove 55 40 to 100 Function Points EXCEL
MATHCAD
Visual DSLsDomain
IdeaFinishedProduct
So
lve
pro
ble
m in
dom
ain
term
sAssembler
Map to code, implement
UML ModelMap to UML
Generate,Add bodies
ComponentsDSVLModel
Generate callsto components
No map!
CodeMap to code, implement
Framework for Domain-Specific Visual LanguagesJuha-Pekka Tolvanen, Steven Kelly, Jeff Gray, Kalle Lyytinen
OOPSLA workshop on DSVL
Visual DLS design and implementation
DomainIdea
FinishedProduct
ComponentsDSVLModel
Generate callsto components
Easy!
Expert(few)
Normal(many)
Codegeneration
DSVLmetamodel
Componentlibrary
Meta CASE for DSVL design
Concepts Symbols
GeneratorsRules1 2 3 4
MDA and Tools
Metamodels
MODELS
Reverse engineering
Import & Export
Textual model Editor
Visual Model Editor
Model Checker
Teamwork
M2M M2text
OTHER MODELS
SOURCE CODE
Metamodel editors
References• Peter Pin-Shan Chen "The Entity-Relationship Model: Toward a Unified
View of Data" ACM on Database Systems, Vol. 1, No. 1, March 1976• Chen, Peter P., Entity-Relationship Modelling: Historical Events, Future
Trends, and Lessons Learned, Springer-Verlag New York, Inc, 2002, pp. 296-310
• D. Harel, "Statecharts: A Visual Formalism for Complex Systems", Sci. Comput. Programming 8 (1987), 231-274.
• J, Rambaugh, Object-Oriented Modeling and Design. With others. Prentice Hall, ISBN 0-13-629841-9, 1991
• G. Booch, Object-Oriented Analysis and Design with Applications. Benjamin Cummings, 1991 (2° Edition 1994, Addison Wesley)
• I. Jacobson, Object-Oriented Software Engineering: A Use Case Driven Approach (ACM Press) With Magnus Christerson, Patrik Jonsson & Gunnar Overgaard. Addison-Wesley, 1992, ISBN 0-201-54435-0, 1992
• I. Jacobson, Grady Booch & James Rumbaugh, The Unified Software Development Process. Addison-Wesley Professional, 1999, ISBN 0-201-57169-2, 1999
References
• Frankel. “Model Driven Architecture: Applying MDA to Enterprise Computing.” Wiley, 2003
• MDA Guide– www.omg.com/mda
• Marjan Mernik, Jan Heering, Anthony M. Sloane: When and how to develop domain-specific languages. ACM Comput. Surv. 37(4): 316-344 (2005)
• Jeff Gray, Kathleen Fisher, Charles Consel, Gabor Karsai, Marjan Mernik, Juha-Pekka Tolvanen: DSLs: the good, the bad, and the ugly. OOPSLA Companion 2008: 791-794
• Juha-Pekka Tolvanen, Steven Kelly, Jeff Gray, Kalle Lyytinen, Framework for Domain-Specific Visual Languages, OOPSLA WS on DSVL 2001
References
• Wynn, Moe T. and Verbeek, H.M.W. and van der Aalst, Wil M. and ter Hofstede, Arthur H.M. and Edmond, David (2007) Business Process Verification - Finally a Reality! Business Process Management Journal.
• Johan den Haan, Model Driven Engineering, http://www.theenterprisearchitect.eu/archive/2009/01/15/mde---model-driven-engineering----reference-guide
• Mike Blechar, David Norton , Trends in Model-Driven Development, 4Q09-3Q10, Gartner