16 September 2009 Copyright © 2009 Data Access Technologies, Inc. Model Driven Solutions Action Language for Foundational UML (Alf) Joint submission of.

Slides:



Advertisements
Similar presentations
CS3012: Formal Languages and Compilers Static Analysis the last of the analysis phases of compilation type checking - is an operator applied to an incompatible.
Advertisements

Intermediate Code Generation
Programming Languages and Paradigms
Restricted © Siemens AG All rights reserved Siemens Corporate Technology | Month 20XX Proposed topics for TDL phase 3.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Chapter 22 UML Tooks and UML as Blueprint Model-Driven Architecture (MDA) Object-Constraint Language (OCL)
Production Rule Representation Team Response Presentation to BEIDTF OMG Montreal Aug 2004 Ruleml.org.
Copyright © 2013 Ivar Jacobson International SA. All rights reserved UML: Once More with Meaning University of Maryland Model-Based System Engineering.
Model-Based Programming: Executable UML with Sequence Diagrams By Ruben Campos Cal State L.A. Computer Science Thesis Work Spring 2007.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Comp 205: Comparative Programming Languages Semantics of Imperative Programming Languages denotational semantics operational semantics logical semantics.
Irina Rychkova. 9/20061 Systemic approach towards model definition Model transformation semantics.
Road Map Introduction to object oriented programming. Classes
1 © Wolfgang Pelz UML3 UML 3 Notations describe how to use reusable software. Package Component Deployment Node.
IBM WebSphere survey Kristian Bisgaard Lassen. University of AarhusIBM WebSphere survey2 Tools  WebSphere Application Server Portal Studio Business Integration.
A Formal Foundation Supporting MDD --- ZOOM Approach Hongming Liu Lizhang Qin 11/08/2003.
HAS. Patterns The use of patterns is essentially the reuse of well established good ideas. A pattern is a named well understood good solution to a common.
II. Middleware for Distributed Systems
© 2008 IBM Corporation Behavioral Models for Software Development Andrei Kirshin, Dolev Dotan, Alan Hartman January 2008.
An Introduction to Rational Rose Real-Time
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Ontologies Reasoning Components Agents Simulations Agent Modeling Language: Behavioral Models Rafael Oliveira Ricson Santana Vinícius Remigo Jacques Robin.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
An Approach and Tool for Synchronous Refactoring of UML Diagrams and Models Using Model-to-Model Transformations Hafsteinn Þór Einarsson Helmut Neukirchen.
1COM6030 Systems Analysis and Design © University of Sheffield 2005 COM 6030 Software Analysis and Design Lecture 4 - System modelling Dr Richard Clayton.
Faculty of Informatics and Information Technologies Slovak University of Technology Peter Kajsa and Ľubomír Majtás Design.
Lecture 9 Polymorphism Richard Gesick.
Executable UML The Models are the Code - Executable UML Lecture 9 - Communication and Relationship Dynamics Paul Krause.
Agenda 1. Introduction 2. Overview of SU-MoVal 3. OCL-based Model Validation 4. QVT-based Transformations 5. Demo of SU-MoVal 6. Conclusion and Future.
Ch:10 Component Level Design Unit 4. What is Component? A component is a modular building block for computer software Because components reside within.
Object-Oriented Analysis and Design An Introduction.
The Java Programming Language
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
4. UML. CPSC 333: Foundations of Software EngineeringJ. Denzinger 4.1. Motivation The Unified Modeling Language tries to integrate older approaches Developed.
Modeling Component-based Software Systems with UML 2.0 George T. Edwards Jaiganesh Balasubramanian Arvind S. Krishna Vanderbilt University Nashville, TN.
“This presentation is for informational purposes only and may not be incorporated into a contract or agreement.”
02/04/2008 A Concrete Syntax for UML 2.1 Action Semantics Using +CAL 13th IEEE International Conference on Engineering of Complex Computer Systems – ICECCS.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Design Model Lecture p6 T120B pavasario sem.
 All calls to method toString and earnings are resolved at execution time, based on the type of the object to which currentEmployee refers.  Known as.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
ESDI Workshop on Conceptual Schema Languages and Tools
Ch- 8. Class Diagrams Class diagrams are the most common diagram found in modeling object- oriented systems. Class diagrams are important not only for.
A division of Data Access Technologies, Inc. Combining Alf and UML in Modeling Tools Ed Seidewitz, Model Driven Solutions Jérémie Tatibouet, CEA 28 September.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 6 Objects and Classes.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
Programmeren 1 6 september 2010 HOORCOLLEGE 2: INTERACTIE EN CONDITIES PROGRAMMEREN 1 6 SEPTEMBER 2009 Software Systems - Programming - Week.
Oct Interchangability in Software Design Notation - Timothy C. Lethbridge Interchangability in software design notation: programs models visual.
UML Profile BY RAEF MOUSHEIMISH. Background Model is a description of system or part of a system using well- defined language. Model is a description.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
OWL Web Ontology Language Summary IHan HSIAO (Sharon)
Interpreting the Object Constraint Presented by: Ed Kausmeyer.
Kyung Hee University Class Diagramming Notation OOSD 담당조교 석사과정 이정환.
Lecturer: Eng. Mohamed Adam Isak PH.D Researcher in CS M.Sc. and B.Sc. of Information Technology Engineering, Lecturer in University of Somalia and Mogadishu.
UML (Unified Modeling Language)
Comparison of ZOOM with other Formal Methodologies Hsiu-Chien Jing SE690 Initial Presentation School of CTI, DePaul University Supervised by Dr. Jia October,
Chapter 1 Overview of UML for Java Programmers. 2 Outline Diagram Types Diagram Types Class Diagrams Class Diagrams Object Diagrams Object Diagrams Sequence.
SysML v2 Formalism Requirements Formalism WG September 15, 2016.
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
Analysis Classes Unit 5.
UNIT 1.
Roberta Roth, Alan Dennis, and Barbara Haley Wixom
Information Science and Engineering
SysML v2 Formalism: Requirements & Benefits
CS 326 Programming Languages, Concepts and Implementation
Proposed SysML v2 Submission Plan
Behavioral Models for Software Development
Object Oriented Programming in java
Presentation transcript:

16 September 2009 Copyright © 2009 Data Access Technologies, Inc. Model Driven Solutions Action Language for Foundational UML (Alf) Joint submission of a Concrete Syntax for a UML Action Language Alf

Page 2 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Submitters Model Driven Solutions Mentor Graphics 88solutions Corporation No Magic Visumpoint

Page 3 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Agenda Purpose and Scope Design Principles Issues To Be Discussed Examples

Page 4 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Purpose and Scope From the RFP: “This request therefore solicits proposals for a concrete syntax for a textual UML Action Language for the action model incorporated into fUML that will operate only at the level of abstraction of UML and which is capable of being translated into different implementations for different platforms and languages.” “The scope of the action language is the action model of the Executable UML Foundation, including the standard model libraries for I/O and basic operations.” “Proposals may incorporate constructs for other elements in the Executable UML Foundation that are not part of the action model, if desired.”

Page 5 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Purpose and Scope (continued) From the RFP: Consider this fragment of pseudo-code that iterates over a list: nextCall := CallListHead; totalTime := 0; While (nextCall != Null) do nextCall := nextCall.next; totalTime += nextCall.minutes; endWhile UML doesn’t specify linked lists; it’s an implementation choice. What happens when the data structure changes? Much of this logic must be modified. Using [Alf] we could instead write: totalTime = #'+'(Call.allinstances().minutes); which finds all the instances of Call, accesses its attribute minutes, uses [a reduce operation] to add them all, and then [provides a loca name for] the value. The data structure is expressed abstractly, at the level of UML, and can be translated to any implementation. Such an abstract language can be translated into multiple different implementations, including even hardware.

Page 6 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Purpose and Scope (continued) However: In Alf, if you want, you can also write: nextCall = CallListHead; totalTime = 0; while (nextCall != null){ nextCall = nextCall.next; totalTime += nextCall.minutes; } if you have explicitly modeled call lists, etc.

Page 7 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Design Principles for Alf A familiar C-legacy (“Java like”) syntax, but with UML textual syntax when it exists. Minimizing the need for graphical models to change in order to accommodate use of the action language. Usable in context of models not limited to the fUML subset. Consistency of language units, however and wherever they are attached to the wider model. A naming system that is based on UML namespaces for referencing elements outside of an activity and a consistent use of names to reference nodes within an activity. An implicit type system based on typing declared in the structural model elements. The expressivity of OCL in the use and manipulation of collections. Concrete syntax for structural modeling (largely within the bounds of the fUML subset).

Page 8 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Issues in Using fUML fUML has higher level constructs than typical target implementation languages, but still lacks some features, e.g.: –Static features –Exceptions Integration into graphical models requires semantics outside the fUML subset, e.g.: –Triggers on state machines –Invocation through ports

Page 9 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Issues to be Discussed Proposals shall discuss the relationship of the concrete syntax to existing OMG language specifications, particularly OCL. –Uses relevant UML 2 textual notation (e.g., “::” for namespace scoping, “name: type” for typing, bracket notation for multiplicity, etc.) –Use OCL-like notation for collection operations Proposals shall discuss how they resolved the tension between the perceived marketability of imperative languages and both OCL and the data-flow nature of the action model. –The overall Java-like, C-legacy syntax is very familiar, and can be used in an imperative way –The OCL-like syntax is smoothly integrated and allows for concurrent, data-flow-oriented expressions –“Local names” within activity code look largely like variables, but are references to them are mapped to object flows

Page 10 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Issues to be Discussed (continued) Proposals shall discuss the relationship to formal specification languages and how an action language “program” may be proven –OCL declarative specifications can be used as the basis for Alf executable specifications –Alf maps semantically to fUML, which has a formal semantic foundation Proposals shall discuss the ease of use and understandability from the point of view of the modeler. –Syntax is familiar to the programming-language mainstream –Common UML textual notations are familiar to the modeler –Syntax supports underlying UML model semantics Proposals shall discuss the parsability of the language (e.g. LL1, LALR). –LL(n) parser implemented using JavaCC technology –Mostly LL(1), but currently requires n=2 or greater in some areas

Page 11 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Conformance Syntactic Conformance Complete Alf. Complete Alf syntax, including structural modeling (“modeling language”) Basic Alf. Excludes structural modeling (“action language”) Simplified Alf. Subset consistent with capabilities of a traditional procedural programming language (“snippet language”) Semantic Conformance Interpretive Execution. Direct interpretation Compilative Execution. Compilation to fUML Translational Execution. Translation to non-UML target platform

Page 12 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 1: run Operation Java Version /** Run the given node activations and then (concurrently) send an offer to all activations for nodes with no incoming edges within the given set. */ void run(Set activations) { for (ActivityNodeActivation activation: activations) { activation.run(); } Collection enabledActivations = new ArrayList (); for (ActivityNodeActivation activation: activations) { boolean isEnabled = activation instanceof ActionActivation && ((Action)activation.node).input.size() == 0 || activation instanceof ControlNodeActivation || activation instanceof ActivityParameterNodeActivation; if (isEnabled) { search: for (ActivityEdgeInstance incomingEdge: activation.incomingEdges) { for (ActivityNodeActivation otherActivation: activations) { if (otherActivation.isSourceFor(incomingEdge)) { isEnabled = false; break search; } if (isEnabled) { enabledActivations.add(activation); } // *** Send offers to all enabled nodes concurrently. *** for (ActivityNodeActivation enabledActivation: enabledActivations) { (new Thread(new OfferSender(enabledActivation))).start(); }

Page 13 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 1: run Operation “Java-like” Alf Version namespace fUML::Semantics::Activities::IntermediateActivities:: ActivityNodeActivationGroup; /** Run the given node activations and then (concurrently) send an offer to all activations for nodes with no incoming edges within the given set. */ activity run(in activations: Set ) { for (activation in activations) { activation.run(); } enabledActivations = ActivityNodeActivation[]{}; for (activation in activations) { isEnabled = activation instanceof ActionActivation && ((Action)activation.node).input -> size() != 0 || activation instanceof ControlNodeActivation || activation instanceof ActivityParameterNodeActivation; for (incomingEdge in activation.incomingEdges while isEnabled) { for (otherActivation in Activations while isEnabled) { if (otherActivation.isSourceFor(incomingEdge)) { isEnabled = false; } if (isEnabled) { enabledActivations -> add(activation); } // *** Send offers to all enabled nodes concurrently. for (enabledActivation in enabledActivations) { enabledActivation.receiveOffer(); }

Page 14 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 1: run Operation OCL 2.0 Specification context ActivityNodeActivationGroup::run(activations: Set(ActivityNodeActivation)) post: activations->forAll(activation | activation^^run()->size() = 1) and let enabledActivations: Set(ActivityNodeActivation) = activations -> select( (oclIsKindOf(ActionActivation) and node.oclAsType(Action).input -> notEmpty() or oclIsKindOf(ControlNodeActivation) or oclIsKindOf(ActivityParameterNodeActivation) and not incomingEdges -> exists incomingEdge ( activations -> exists(isSourceFor(incomingEdge) ) in enabledActivations -> forAll(enabledActivation | enabledActivation^^receiveOffer()->size() = 1 )

Page 15 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 1: run Operation “OCL-like” Alf namespace fUML::Semantics::Activities::IntermediateActivities:: ActivityNodeActivationGroup; /** Run the given node activations and then (concurrently) send an offer to all activations for nodes with no incoming edges within the given set. */ activity run(in activations: ActivityNodeActivation[*]) { activations -> iterate activation (activation.run()); enabledActivations = activations -> select activation ( (activation instanceof ActionActivation && ((Action)activation.node).input -> notEmpty() || activation instanceof ControlNodeActivation || activation instanceof ActivityParameterNodeActivation) && !activation.incomingEdges -> exists incomingEdge ( activations -> exists otherActivation ( otherActivation.isSourceFor(incomingEdge) ) ); // *** Send offers to all enabled nodes concurrently. *** enabledActivations.receiveOffer(); }

Page 16 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 1: run Operation Activity Diagram

Page 17 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 2: Online Bookstore Ordering Subsystem

Page 18 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 2: Online Bookstore Order Class

Page 19 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 2: Online Bookstore establishCustomer Operation namespace Ordering::Order; private import TIM; /** From Executable UML, Figure B.3, entry behavior for Establishing Customer and Verifying Payment */ activity establishCustomer(in rcvd_evt: CheckOut) { R10 -> add ( 'selections are purchased in' => this, 'is a purchase of selections in' => rcvd_evt.cart ); matchingCustomers = Customer -> select c (c. == rcvd_evt.customer ); if (matchingCustomers->isEmpty()) { customer = new Customer(); customer. = rcvd_evt.customer ; } else { customer = matchingCustomers[1]; } customer.name = rcvd_evt.customerName; customer.shippingAddress = rcvd_evt.shippingAddress; customer.phone = rcvd_evt.customerPhone; R5 -> add ( places => this, 'is placed by' => customer ); this.dateOrderPlaced = TIM::current_date; this.SubmitCharge( accountNumber => rcvd_evt.accountNumber, billingAddress => rcvd_evt.billingAddress, cardExpirationDate => rcvd_evt.cardExpirationDate, cardholderName => rcvd_evt.cardholderName); }

Page 20 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 2: Online Bookstore Order Class – Alf Version namespace Ordering; /** From Executable UML, Figure B.2, with statechart from Figure B.3 */ active class Order { public orderID: arbitrary_id; public dateOrderPlaced: date; public totalValue: Money; public recipient: PersonalName; public deliveryAddress: MailingAddress; public contactPhone: TelephoneNumber; public receive signal CheckOut; public receive signal SubmitCharge; public receive signal PaymentDeclined{} public receive signal PaymentApproved{} public receive signal OrderDelivered{} private establishCustomer(in rcvd_evt: CheckOut); private processCharge(in rcvd_evt: SubmitCharge); private declineCharge(); private packAndShip(); private notifyOfDelivery(); } do …

Page 21 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 2: Online Bookstore Order Class – Alf Version (continued) { /** 1. Establishing Customer and Verifying Payment */ accept (checkOut: CheckOut); this.EstablishCustomer(checkOut); do { /** 2. Submitting Charge */ accept (chargeSubmission: SubmitCharge); this.ProcessCharge(chargeSubmission); accept (PaymentDeclined) { declined = true; /** 3. Payment Not Approved */ this.DeclineCharge(); } or accept (PaymentApproved) { declined = false; } } while (declined); /** 4. Being Packed and Shipped */ this.PackAndShip(); /** 5. Delivered to Customer */ accept(OrderDelivery); this.NotifyOfDelivery(); }

Page 22 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 3: Property Management Service

Page 23 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 3: Property Management Service Service Model

Page 24 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Example 3: Property Management Service establish Operation namespace 'Property Management'::'Service Model':: 'Property Management Service Implementation'; private import 'Property Management'::'Data Model'::Properties::*; private import 'Property Management'::'Message Model'::*; /** Establish a new property record. */ activity establish ( in request: 'Property Record Establishment', out reply: 'Property Management Success Reply' [0..1], out error: 'Error Reply' [0..1] ) { identifier = this.'property identifier factory'.'get next identifier'(); if (request.'property type' == 'Property Type'::personal) { property = new 'Personal Property'::'create property'(identifier, request.name); } else { property = new 'Real Property'::'create property'(identifier, request.name); } reply = this.'create reply'(request.identifier, property); }

Page 25 Alf Copyright © 2009 Data Access Technologies, Inc. ModelDriven Solutions 16 September 2009 Demonstration Alf Reference Implementation activity Hello() { WriteLine("Hello World!"); } activity Hello() { WriteLine("Hello World!"); } namespace ::FoundationalModelLibrary; package BasicInputOutput { … public activity WriteLine(in value: String, out errorStatus: Status[0..1]) { StandardOutputChannel.allInstances().writeLine(value, errorStatus); } } namespace ::FoundationalModelLibrary; package BasicInputOutput { … public activity WriteLine(in value: String, out errorStatus: Status[0..1]) { StandardOutputChannel.allInstances().writeLine(value, errorStatus); } }