Скачать презентацию 2014 andromda org Andro MDA Boot Camp Скачать презентацию 2014 andromda org Andro MDA Boot Camp

e0a2bf36607ebbe2e3e95002dcdbb9d4.ppt

  • Количество слайдов: 74

© 2014 andromda. org Andro. MDA Boot Camp © 2014 andromda. org Andro. MDA Boot Camp "From scratch to your own cartridge in four days" Part 1: Modeling and Code Generation using the existing Cartridges Copyright © 2014: andromda. org (BSD License)

© 2014 andromda. org MDSD with Magic. Draw and Andro. MDA Part 1: Modeling © 2014 andromda. org MDSD with Magic. Draw and Andro. MDA Part 1: Modeling and Code Generation using the existing Cartridges Copyright © 2007: Matthias Bohlen, all rights reserved

© 2014 andromda. org Andro. MDA Boot Camp (Part 1) 3 © 2014 andromda. org Andro. MDA Boot Camp (Part 1) 3

© 2014 andromda. org The basics 4 © 2014 andromda. org The basics 4

© 2014 andromda. org • • MDA Model and metamodel Platform defined PIM and © 2014 andromda. org • • MDA Model and metamodel Platform defined PIM and PSM UML profile – Stereotypes – Tagged Values • Roles, tasks and skills • Collaborating in a project 5

© 2014 andromda. org MDA by definition • MDA is a collection of specifications © 2014 andromda. org MDA by definition • MDA is a collection of specifications • The key idea is… "…to build a comprehensive, formally correct model for the construction of a software system, from which the executable software components can be generated by automated transformations. " 6

© 2014 andromda. org What is MDA? • Generating software. . . – by © 2014 andromda. org What is MDA? • Generating software. . . – by transformation of a model – into software artifacts – by means of templates • But we had this already years ago? ! • Abstraction level and standards make the difference: – Modeling: UML – Storage for models: MOF – Exchange of models: XMI 7

© 2014 andromda. org Why MDA? • Complexity – Software becomes more and more © 2014 andromda. org Why MDA? • Complexity – Software becomes more and more complex – Technological change accelerates – Abstraction must help to conquer complexity • Quality is a critical aspect of software • Frameworks cause repeated code – Coding becomes repetitive and "boring" 8

© 2014 andromda. org History and future Abstraction level (next big wave) MDA Frameworks © 2014 andromda. org History and future Abstraction level (next big wave) MDA Frameworks (OOP) Object oriented Procedural Assembly language 1950 1960 1970 1980 1990 2000 2010 2020 Time 9

© 2014 andromda. org Core concepts of MDA • Software is generated from models © 2014 andromda. org Core concepts of MDA • Software is generated from models • Abstraction from technical Platform èPIM (Platform Independent Model) • Mapping to arbitrary platforms èPSM (Platform Specific Model) 10

© 2014 andromda. org Overview of core concepts 11 © 2014 andromda. org Overview of core concepts 11

© 2014 andromda. org From requirements to code existing Requirements new in MDA Legend © 2014 andromda. org From requirements to code existing Requirements new in MDA Legend PIM PSM (J 2 EE) PSM (. NET) PSM (CORBA) PSM (. . . ) Code (J 2 EE) Code (. NET) Code (CORBA) Code (. . . ) 12

© 2014 andromda. org Definition of model • Model – A model is the © 2014 andromda. org Definition of model • Model – A model is the abstraction of an application domain (shop, bank, etc. ) – Example 1: A model for a shop contains notions like order and price – Example 2: A model for a bank contains notions like account and transfer 13

© 2014 andromda. org Definition of metamodel • Metamodel – A metamodel is a © 2014 andromda. org Definition of metamodel • Metamodel – A metamodel is a model for the application domain called modeling – Example 1: The metamodel of XML contains notions like node, element and attribute – Example 2: The metamodel for UML contains notions like class, property, operation, association 14

© 2014 andromda. org Models on metalevels M 0 -M 2 Metamodel (M 2) © 2014 andromda. org Models on metalevels M 0 -M 2 Metamodel (M 2) Class Property -name : String instance. Of UML model (M 1) instance. Of -from. Account -account. Number : String instance. Of -name : String -to. Account instance. Of Transfer -amount : Number instance. Of Application data (M 0) a 1 : Account 123 -456 -789 a 2 : Account t : Transfer 456 -789 -123 1500 15

© 2014 andromda. org UML profile: What is it? • Standard mechanism to extend © 2014 andromda. org UML profile: What is it? • Standard mechanism to extend the scope of UML • Language elements used – Stereotypes – Tagged Values (UML 2 Stereotype attributes) – OCL Constraints 16

© 2014 andromda. org Stereotypes • Stereotypes – classify model elements – almost create © 2014 andromda. org Stereotypes • Stereotypes – classify model elements – almost create new "metaclasses" – can be attached to any normal model element • Class, Property, Operation, Parameter • State, Transition, etc. • Stereotypes provide application specific annotations for model elements – Some UML tools allow to associate an icon to a stereotype 17

© 2014 andromda. org Tagged Values • Tagged Values – extend the attribute set © 2014 andromda. org Tagged Values • Tagged Values – extend the attribute set of a metaclass – can be associated to a metaclass and (optionally) a stereotype – UML 2: Tagged Values must belong to a Stereotype (known as Stereotype Attributes) • Using Stereotypes and Tagged Values, you create your own "modeling vocabulary" • Restriction: – The UML metamodel is still the limit – You can only model what conforms to the UML metamodel 18

© 2014 andromda. org Collaboration using MDA Architectural and quality goals Feedback from daily © 2014 andromda. org Collaboration using MDA Architectural and quality goals Feedback from daily work Template 4: Generate Code 1: Design templates Architect Generator 2: Create model XM I Code Business analyst Build script Components, DB scripts, etc. UML 3: Annotate model Developer 6: Compile and package 5: Write business logic 7: Deploy and test 19

© 2014 andromda. org Roles and skills for MDA Role Tasks Skills Business analyst © 2014 andromda. org Roles and skills for MDA Role Tasks Skills Business analyst Creates a business model of the application domain Insight, domain knowledge, talent for abstraction, modeling language (UML or DSL) Architect Defines application architecture, creates templates and transformation rules to map business to technology (Meta-)Modeling, deep knowledge of architecture, frameworks and target platform in general Developer Lets the generator create the "boring" part of the application and adds the business logic by hand Understanding of the model, business requirements, programming 20

© 2014 andromda. org Target technologies (examples) • Spring – a framework to structure © 2014 andromda. org Target technologies (examples) • Spring – a framework to structure J 2 EE applications • Hibernate – a persistence mapping framework • Struts – a Model-View-Controller framework for web applications 21

© 2014 andromda. org Introduction to Spring • Framework simplifies development of J 2 © 2014 andromda. org Introduction to Spring • Framework simplifies development of J 2 EE applications • Lightweight Io. C container • Instantiates and links Java. Beans • Wraps Java. Beans with aspects for transaction handling and other useful stuff 22

© 2014 andromda. org Inversion of Control • Hollywood principle – Don't call me, © 2014 andromda. org Inversion of Control • Hollywood principle – Don't call me, I'll call you! • Example: 23

© 2014 andromda. org Hollywood principle in © 2014 andromda. org Hollywood principle in "Shop" • Not like this… public void refill. Stock() { Supplier my. Supplier = (Supplier)Factory. find("Wholesale. Company"); my. Supplier. place. Order(100, "apple", "sweet"); } • but like this: public void set. My. Supplier(Supplier s) { this. my. Supplier = s; } public void set. Apple. Refill. Count(int count) { this. apple. Refill. Count = count; } public void refill. Stock() { my. Supplier. place. Order(this. apple. Refill. Count, "apple", "sweet"); } 24

© 2014 andromda. org And then in Spring… • application. Context. xml <bean id= © 2014 andromda. org And then in Spring… • application. Context. xml 100 25

© 2014 andromda. org Advantages of Spring • Spring classes are ordinary Java. Beans © 2014 andromda. org Advantages of Spring • Spring classes are ordinary Java. Beans – no dependency to a Spring API – testable with JUnit without a container – strong typing, no generic factories like JNDI • Spring integrates a lot of ready made stuff – Data sources, transactions, persistence, security, remoting, etc. • Business classes stay untouched • Later, we'll see more in practice! 26

© 2014 andromda. org Andro. MDA 3. x component architecture <<Metafacade>> UML (1. 4), © 2014 andromda. org Andro. MDA 3. x component architecture <> UML (1. 4), 2. 0 <> hibernate, ejb bpm 4 struts, meta, java <> java hypersonic, mysql <> container <> MDR, EMF Core <> OCL <