The Models are the Code Executable UML CS
The Models are the Code Executable UML CS 387 Paul Krause Executable UML
Lecture 1 - Introduction and Motivation v New Terminology v Motivation v What is a model? v Introduction to x. UML Executable UML
New Terminology for Today v Executable UML (x. UML) v Platform Independent Model (PIM) v Platform Specific Model (PSM) Executable UML
Motivation - Raising the Level of Abstraction Assembly Code High-Level Language Source Code Executable Models Assembler Source Code Compiler Model Compiler Machine Code 1960 s Assembly Code 1980 s Source Code 2000 s None Executable UML Hardware Platform Software Platform
Motivation - Raising the Level of Reuse Domain Models Components and Frameworks Objects Functions 1970 s Executable UML 1980 s 1990 s 2000 s
Motivation - Architectural Mismatch Reuse at the Code-Level Application is Multiplicative e. g. CORBA 3 x Data Server 3 x Operating System 3 = 27 code versions Executable UML
The Vision of Model Driven Architecture v 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) Executable UML
Lecture 1 - Introduction and Motivation v New Terminology v Motivation v What is a model? v Introduction to x. UML Executable UML
Abstraction, Classification and Generalisation Real World Models Fido (20 kg, Awful): Dog Abstract Munchkin (8 kg, Feeding. Only): Cat Real Entities Lap. Kitty (4 kg, Lap. Lover): Cat Classify Instance Model Pet + name + weight Abstract Entity Classifications Executable UML Dog +slobber. Factor Cat +standoff. Index Class Model
Subject Matter and Language Abstraction Transaction * amount ID type Customer operates on Account 1. . 2 is owned by 1 name city is. Primary is affected by number owns balance * Chacking. Account max. Checksper. Month Executable UML Savings. Account interest. Rate
How do we know if a Customer is authentic? v The banking model abstracts away irrelevant information v e. g. customer’s salary, number of children, personal hobbies, etc v But the process of authenticating a customer is relevant v So, how come it is not present in the model? v This is because Security is a different (and general purpose) subject domain Executable UML
Security Domain Model entity on whose behalf actions are performed Principal affected by system actions Protected. Resource 0. . * Role Protected. Action 0. . * defines a relationship between a Principal and the System action subject to authorisation Permission Executable UML reflects the actions that a Principal, acting in a particular Role, can take with regard to a Protected. Resource
Separation of concerns v We could have a number of different ways of handling security in a banking domain v Any given model of security could be applied to a number of different application domains v So, we model the bank without worrying about security v And, model security without worrying about its potential applications v But we do need to hook the two models together Executable UML
Lecture 1 - Introduction and Motivation v New Terminology v Motivation v What is a model? v Introduction x. UML Executable UML
Terminology in x. UML v The Model v The Platform-Independent Model (PIM) v The Platform-Specific Model (PSM) Executable UML
The Model v a “formal representation of the function, behaviour and structure of the system we are building” - [Raistrick et al, 2004] v We will use x. UML to specify complete and rigorous models v Two kinds of models: v Platform-independent Model (PIM) v Platfrom-specific model (PSM) v So, what do we mean by a “platform” Executable UML
The Platform v the “technological and engineering details that are irrelevant to the fundamental functionality of the software” - [Raistrick et al, 2004] v Examples: v CORBA v J 2 EE v. C v. NET v a Real-Time Operating System (RTOS) v Note, we may need to say which Platforms are PIMs are independent of! Executable UML
The Platform-Independent Model (PIM) v Captures all the business requirements of the system under construction, free from implementation detail v They must nevertheless be precise and complete v still include all the hard bits! v Several PIMs will be used to specify a system v each PIM captures a distinct aspect of the system v we term these domains v we use x. UML so the PIMs can be combined and executed Executable UML
The Platform-Specific Models v The PSM is a realisation of a PIM for a specific platform v The PIM is “elaborated” with all the implementation details needed to execute it on a specific platform v The PSM is obtained by mapping the PIM to a specific platform v That is, we apply a set of transformation rules to the PIM to obtain a PSM v MDA has most benefit if the PSM is always generated from the PIM v the PSM is not a maintained deliverable - changes are made to the PIM only, and the PSM regenerated Executable UML
Mappings are reusable Air Traffic Control PIM Command & Control PIM Shared Common Mapping from PIM to PSM Air Traffic Control PSM Executable UML Command & Control PSM
Executable UML (x. UML) x. UML = UML - Semantically Weak Elements + Precisely Defined Action Semantics v a clearly defined simple model structure v a precise semantics for actions v a compliant Action Specification Language (ASL) v a process that supports executable modelling, large-scale reuse and pattern-based design Executable UML
- Slides: 21