Model Driven Software Development

16 downloads 129 Views 509KB Size Report
Aug 4, 2011 ... Schach S.R. Object-Oriented and Classical Software Engineering, ... Stahl T., Völter M. Model Driven Software Development: technology, ...
2011.08.04.

Baltic Summer School - Technical Informatics & Information Technology (BaSoTi) Riga (Latvia) August 2011

Model Driven Software Development Oksana Nikiforova [email protected]

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Contact  

Prof. Oksana Nikiforova Riga Technical University



Kalku iela 1, Riga, LV-1658, Latvia Phone: (+371) 67089598 Fax: (+371) 67089596



Email: [email protected]

 

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

2

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Literature             

Sommerville I. Software Engineering (7th Edition) (International Computer Science Series), 2005 Schach S.R. Object-Oriented and Classical Software Engineering, McGrawhill, 6-th Edition 2005 Dennis A., Wixom B. H., Tegarden D. System Analysis and Design with UML Version 2.0, Wiley&Sons, 2005 Satzinger J. W., Jackson R. B., Burd S. D. Object-Oriented Analysis and Design with the Unified Process, Thomson’s Course Technology, 2005 OMG Unified Modeling Language Specification, Ver. 2.0. / http://www.uml.org/ Fowler M. UML Distilled: A Brief Guide to the Standard Object Modeling Language,Third Edition, AddisonWesley, Object Technology series, 2004 Siegel J. Developing in OMG’s Model-Driven Architecture. OMG White Paper, Nov 2001 Stahl T.,Völter M. Model Driven Software Development: technology, engineering, management, Wiley, 2006 Kleppe A., Warmer J., Bast W. MDA Explained: The Model Driven Architecture--Practice and Promise, Addison-Wesley, Object Technology series, 2003 Mellor S.J., Scott K, Uhl A., Weise D. MDA Distilled: Principles of Model-Driven Architecture, AddisonWesley, Object Technology series, 2004 Frankel D.S. Model Driven Architecture: Applying MDA to Enterprise Computing, OMG press, Wiley Publishing, 2003 Hansen J.E., Thomsen C. Enterprise Development with Visual Studio .NET, UML, and MSF, Apress, 2004 Filev A., Loton T, McNeish K., Schoellmann B., Slater J., Wu C.G. Professional UML with Visual Studio .NET, Unmasking Visio for Enterprise Architects, Wiley Publishing, 2003

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

3

1

2011.08.04.

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Content 

Role of Models and Modelling in Software Development   



Fundamentals of Model Driven Software Development    

  

Software Engineering as an Engineering Science Object Oriented Approach to Software Engineering Unified Modeling Language Models Transformations Metamodelling Tools

Definition of PIM Transformation from PIM to PSM Generation of Code O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

4

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Software crisis in the late 1960s   

The software crisis is originally defined in terms of productivity, but evolved to emphasize quality. Software crisis refer to the inability to hire enough qualified programmers. Symptoms:   



1968. Garmisch-Partenkirchen – NATO seminar – statement of software crisis. 



Cost and Budget Overruns Property Damage Life and Death

Software Engineering is proclaimed as an Engineering Science.

Solution:     

Tools Discipline Formal methods Process Professionalism

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

5

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

6

2

2011.08.04.

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

What is the problem?  

Only 16.2% of projects are completed on-time & onbudget. Over 50% of software projects never see the light of day:   



They never worked Too late for the market window Did not do what the customer wanted

Most projects are:    

Late in delivery Missing functionality Have major defects (bugs) Hard to maintain and support O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

7

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Software: why is it hard? 

   

Software production often runs into problems, because it is mostly concerned with completing a design that works as soon as possible. Each development activity is focused on developing a specific feature. Products (and even different sections within a product) are designed independently from each other. Software systems can become extremely complex during the development process. The best methods for controlling this complexity are abstraction and encapsulation: if we use some techniques for building software that is less complex, we will get benefits in  

software that is more flexible: easier to maintain and modify later some opportunities to reuse designs and code

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

8

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Engineering Methodology  

What is engineering and how does it differ from science? Engineering is the application of science to the needs of humanity. 



This is accomplished through the application of knowledge, mathematics, and practical experience to the design of useful objects or processes in a cost effective way.

Methodology of engineering        

Understanding the problem How to approach a problem Developing and following requirements Writing and reading specifications Analyzing a problem Designing a solution Verifying each step Testing the design against the original problem statement O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

9

3

2011.08.04.

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

The traditional software lifecycle Feasibility study Requirements analysis and specifications  Design and specification  Implementation (coding and module test)  Integrate/test (system testing)  Install/operate (delivery)  Maintain - 70% of cost Frame of reference for us  

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

10

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

SDLC Meta-Phases 

Requirements Definition 



Design 



Determine detailed needs of the project stakeholders. Document those needs.Verify that your understanding is complete and correct. Synthesize a design to meet the requirements. Create a model or prototype.Verify the design meets requirements.

Implementation 

Make the design manifest. Create software artifacts based upon the design. Verify the work. Install the work in the stakeholder’s context. Ensure the users can properly apply the software.

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

11

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Lifecycle Models 

Requirements Phase

Staged models 

Requirements Description

Specification Phase Design Phase

successive stages of development

Specification

Design Docs Implementation & Integration Phase

Product

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

12

4

2011.08.04.

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Object- oriented analysis      

Defines the problem domain according to the requirements. Sets the basic “vocabulary” of the problem domain for the design and coding activities. Surveys the possible solutions and discusses tradeoffs. Provides the environment for productive team analysis. Models the problem from the object perspective. One advantage of object oriented analysis: the analysts don’t have to be “language experts”. 

The experts in the problem domain and the implementationlevel experts can communicate using a common notation. O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

13

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Object-oriented design  

Takes the products produced by analysis, then details and designs the solution in terms of some target environment. Concerned with real-world concerns like   



 

Reliability Performance Capacity

Deals with “assignment of functionality to different processes or tasks”, so there is significant knowledge of the operating system at design time. Deals with database issues and “distributed object environments”. Object oriented analysis and object oriented design use the same kinds of modeling notations - the main difference is “problem” vs. “solution” modeling.

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

14

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Object-oriented programming   

Translates OO design into code. OO programming can actually be done in any language: even C, COBOL, or assembler. There are languages that provide better support for OO programming.  

 

Examples: Smalltalk, Java, C++, C#. These languages support the notions of class, object, messaging, inheritance, encapsulation, polymorphism.

In object oriented programming, reuse of existing libraries is very important. OO programs often create new objects as needed (and destroy them when they are no longer active), so OO programs may use a lot of “dynamic memory”. O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

15

5

2011.08.04.

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Object Oriented Modeling 

An Object-Oriented System 



Depends on "local" knowledge of objects to accomplish their tasks.There are very few things an object can do on its own, in order to accomplish any significant task, objects must communicate with other objects.

Emphasis on Abstraction   

Model relevant attributes and behavior of a given entity for a particular purpose. Focus on what an object "is" and "does.” Class defines both behavior and state.

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

16

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Software crisis – new wave 

Prominence of the Internet in 1990:   



Impotence to manage the software complexity :     



Very rapid growth in the demand for international information systems on the World Wide Web. Typical computer-user bases went from hundreds, or thousands of users, to, often, many-millions of international users. Heterogenous platforms, nets, languages and software systems. CASE tools very limited to extend specification language. Lack of standard for graphical modelling language. Lack of middleware platform. Complexity of generated code. Gap between models and implementation.

Solution:  

Rising the level of abstraction. Importance of system modeling. O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

17

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

An Importance of System Modelling  

 



System modelling is a way of thinking about problems using models organized around real-world ideas. Models are useful for understanding problems, communicating with everyone involved with the project (customers, domain experts, analysts, designers etc), modelling enterprises, preparing documentation and designing programs and databases. Modelling promotes better understanding of requirements, cleaner designs and more maintainable systems. Models are abstractions that portray the essentials of a complex problem or structure by filtering out nonessential details, thus making the problem easy to understand. The UML is declared as a standard for presentation of software system model and provides a notation, which grows from analysis through design into implementation in object oriented programming languages. O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

18

6

2011.08.04.

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

The Unified Modeling Language   

The UML is standard diagramming language to visualize the results of analysis and design. Notation (the UML) is a simple, relatively trivial thing. Much more important: Skill in designing with objects. 



Learning UML notation does not help

The UML is not   

a process or methodology object-oriented analysis and design guidelines for design

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

19



Requirements Phase

Requirement specification document

Requirement Specification analysis Phase



 

Use-Case Model

Design Design Phase

Conceptual model

Class Diagram

Interaction diagram

Implementation Implementation & Integration Phase

Component View

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

20

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Model Driven Architecture Another model

PIM



Additional information



Transformation specification

PSM

Platform

1. 2.

Code

3.



Model Driven Architecture (MDA) Object Management Group (OMG) Separates the specification of IT system functionality from the specification of the implementation of that functionality on a specific technology platform:

Build a model with a high level of abstraction, which is independent of any implementation technology - Platform Independent Model (PIM). Transform the PIM into one or more models that are tailored to specify the system in terms of the implementation constructs that are available in one specific implementation technology - Platform Specific Model (PSM). Transform the PSMs to code. Because a PSM fits its technology very closely, the last transformation is straight-forward.

MDA is about using modelling languages as programming languages rather than merely as design languages. New term, old invention: CASE-tools in 1980’s, integrated object-oriented development environments in 1990’s, UML tools, etc. O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

21

7

2011.08.04.



Requirements Phase

CIM

Requirement specification document

Requirement Specification analysis Phase



 

Use-Case Model

Design Design Phase

PIM Conceptual model

PSM

Class Diagram

Interaction diagram

Implementation Implementation & Integration Phase

ISM / Code Component View O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

22

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Related standards      

Unified Modeling Language (UML) Meta-Object Facility (MOF) XML Metadata Interchange (XMI) Enterprise Distributed Object Computing (EDOC) Software Process Engineering Metamodel (SPEM) Common Warehouse Metamodel (CWM)

The term “architecture” in Model-driven architecture does not refer to the architecture of the system being modeled, but rather to the architecture of the various standards and model forms that serve as the technology basis for MDA. O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

23

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

MDA implementation

ADL/ ASL UML CWM

DSL

Problem Domain models Architecture Analysis Desugn

model transformation

PIM Templates

Model maintenance and exchange

MOF XMI

Action ... semantics UML profiles ...

model transformation

PSM

model transformation Generate / derive

UML Java/EJB CORBA IDL

Source code

Configuration files

...

Running system

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

24

8

2011.08.04.

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Key terms of MDA 

Model 



Platform 



Technological and engineering details that are irrelevant to the fundamental functionality of a software component.

Platform Independent Model (PIM) 



A formal specification of the function, structure and/or behavior of a system.

A formal specification of the structure and function of a system that abstracts away technical details.

Platform Specific Model (PSM) 

The technical details (EJB, CORBA, etc.) O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

25

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Model vs. Modeling language

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

26

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Model of the model = metamodel  



Model of the modelling language Defines syntax and semantics of the modelling language Interoperability for modelling and transformation tools

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

27

9

2011.08.04.

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Model transformation language

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

28

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

MDA supporting “environment”

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

29

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Modeling Maturity Levels 

Modeling Maturity Levels is a classification system, where the levels characterize the role of modeling in a software project:      

Level 0: No Specification Level 1: Textual Specification Level 2: Text with Models Level 3: Models with Text Level 4: Precise Models Level 5: Models only

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

30

10

2011.08.04.

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

MDSD vs. MDA 

Level 4: Precise Models: the specification of the software is written down in one or more models.



Level 5: Models only: the models are precise and detailed enough to allow complete code generation.

Model

Code

Model

Running system

Code

Running system

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

31

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Model Driven Software Development Step 1: Build PIM 

Modelling standart: 



UML 2.0



Modelling tool: 

Sparx Enterprise Architect

Requirement specification document

Requirement analysis



Use-Case Model

 

Conceptual model

Design Class Diagram

Interaction diagram

Implementation Component View

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

32

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Model Driven Software Development Step 2: Transform PIM into PSM 

Transformation support: 



Enterprise Architect



Platforms:   

Microsoft Visual Studio .NET DDL Etc.

Requirement specification document

Requirement analysis



Use-Case Model

 

Conceptual model

Design Class Diagram

Interaction diagram

Implementation Component View

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

33

11

2011.08.04.

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Model Driven Software Development Step 3: Generate code 

Generation support: 



Sparx Enterprise Architect



Implementation:   

C# MySQL Etc.

Requirement specification document

Requirement analysis



Use-Case Model

 

Conceptual model

Design Class Diagram

Interaction diagram

Implementation Component View

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

34

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Summary (1/2) 

What is MDSD? 

Using modelling languages as declarative progamming languages  

rising of abstraction level for programmers; improved productivity, quality, longevity outlook.



Models are centric.



Focus on Platform Independent Models (PIM).



  

Target middleware is not important. Without middleware details. Define PIM to PSM transformations. Preserving PIM when new middleware appears.

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

35

Baltic Summer School 2011, Riga, Latvia, 12.08.-27.08.2011

Summary (1/2) 

Why still MDSD not MDA?  

Few MOF compliant tools to experiment the creation of new component meta models. Developing UML profiles are time and money consuming 

 

 



UML Profile Builders are still expensive and proprietary

Few formalisms to express MDA transformation Few PSM meta models for Programming languages like Java, C++, … Component standard middleware

No portability of developed UML profiles between UML Tools!!!

O. Nikiforova, Riga Technical University, Latvia - Model Driven Software Development

36

12