executable uml the models are the code - executable uml cs387 paul krause

21
Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Upload: annabel-marianna-jennings

Post on 11-Jan-2016

233 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

The Models are the Code -Executable UML

CS387

Paul Krause

Page 2: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Lecture 1 - Introduction and Motivation

New Terminology

Motivation

What is a model?

Introduction to xUML

Page 3: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

New Terminology for Today

Executable UML (xUML)

Platform Independent Model (PIM)

Platform Specific Model (PSM)

Page 4: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Motivation - Raising the Level of Abstraction

Assembly Code

Assembler

None

Machine Code1960s

High-LevelLanguage

Source Code

Source CodeCompiler

HardwarePlatform

Assembly Code1980s

ExecutableModels

ModelCompiler

SoftwarePlatform

Source Code2000s

Page 5: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Domain Models

2000s

Components and

Frameworks

1990s

Objects

1980s

Motivation - Raising the Level of Reuse

Functions

1970s

Page 6: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Motivation - Architectural Mismatch

Operating System

Data Server

CORBA

Application

Reuse at the Code-Level

is Multiplicative

e.g.

3

x

3

x

3

= 27 code versions

Page 7: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

The Vision of Model Driven Architecture

To create an application on a new platform:

1. Take a model of the application domain off the shelf

2. Subset the model as necessary

3. Take models of the implementation technologies off the shelf

4. Describe how the models are to be linked

5. Generate the system

(After Mellor et al, 2004)

Page 8: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Lecture 1 - Introduction and Motivation

New Terminology

Motivation

What is a model?

Introduction to xUML

Page 9: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Abstraction, Classification and Generalisation

Classify

Real World Models

Fido (20kg, Awful): Dog

Munchkin (8kg, FeedingOnly): Cat

LapKitty (4kg, LapLover): Cat

Classify

Abstract

Pet+ name+ weight

Dog+slobberFactor

Cat+standoffIndex

Abstract

RealEntities

EntityClassifications

Instance Model

Class Model

Page 10: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Subject Matter and Language Abstraction

Transaction

amountIDtype

Customer

namecityisPrimary

Account

numberbalance

SavingsAccount

interestRate

ChackingAccount

maxChecksperMonth

is owned by owns

1 *

is affected by

operates on*

1..2

Page 11: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

How do we know if a Customer is authentic? The banking model abstracts away

irrelevant information e.g. customer’s salary, number of children,

personal hobbies, etc

But the process of authenticating a customer is relevant

So, how come it is not present in the model?

This is because Security is a different (and general purpose) subject domain

Page 12: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Security Domain Model

Principal ProtectedResource

Role ProtectedAction

Permission

0..*

0..*

0..* 0..*

0..*

affected by system actions

action subject to authorisation

entity on whose behalf actions are performed

defines a relationship between a Principal

and the Systemreflects the actions that a Principal,

acting in a particular Role,can take with regard to a

ProtectedResource

Page 13: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Separation of concerns

We could have a number of different ways of handling security in a banking domain

Any given model of security could be applied to a number of different application domains

So, we model the bank without worrying about security

And, model security without worrying about its potential applications

But we do need to hook the two models together

Page 14: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Lecture 1 - Introduction and Motivation

New Terminology

Motivation

What is a model?

Introduction xUML

Page 15: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Terminology in xUML

The Model

The Platform

The Platform-Independent Model (PIM)

The Platform-Specific Model (PSM)

Page 16: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

The Model

a “formal representation of the function, behaviour and structure of the system we are building” - [Raistrick et al, 2004]

We will use xUML to specify complete and rigorous models

Two kinds of models: Platform-independent Model (PIM) Platfrom-specific model (PSM)

So, what do we mean by a “platform”

Page 17: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

The Platform

the “technological and engineering details that are irrelevant to the fundamental functionality of the software” - [Raistrick et al, 2004]

Examples: CORBA J2EE C .NET a Real-Time Operating System (RTOS)

Note, we may need to say which Platforms are PIMs are independent of!

Page 18: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

The Platform-Independent Model (PIM)

Captures all the business requirements of the system under construction, free from implementation detail

They must nevertheless be precise and complete still include all the hard bits!

Several PIMs will be used to specify a system each PIM captures a distinct aspect of the

system we term these domains we use xUML so the PIMs can be combined and

executed

Page 19: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

The Platform-Specific Models

The PSM is a realisation of a PIM for a specific platform The PIM is “elaborated” with all the

implementation details needed to execute it on a specific platform

The PSM is obtained by mapping the PIM to a specific platform That is, we apply a set of transformation rules to

the PIM to obtain a PSM

MDA has most benefit if the PSM is always generated from the PIM the PSM is not a maintained deliverable - changes

are made to the PIM only, and the PSM regenerated

Page 20: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Mappings are reusable

Command & Control PIMAir Traffic Control PIM

Air Traffic Control PSM Command & Control PSM

Shared Common Mapping

from PIM to PSM

Page 21: Executable UML The Models are the Code - Executable UML CS387 Paul Krause

Executable UML

Executable UML (xUML)

a clearly defined simple model structure

a precise semantics for actions

a compliant Action Specification Language (ASL)

a process that supports executable modelling, large-scale reuse and pattern-based design

xUML UMLSemantically

WeakElements

PreciselyDefined Action

Semantics= - +