57986e4ac23950368d505d82dca64385.ppt
- Количество слайдов: 45
Meta-model based system design Gábor Privitzky Gabor. Privitzky@ericsson. com Gábor Zsolt Nagy Gabor. Zsolt. Nagy@ericsson. com
Table of contents • • • Today’s software design Analysis and design Elaboration modeling approach Meta-models Translation modeling approach Experiences at Ericsson Hungary Software Technology Forum Meta-model based system design 2004 -11 -08
MDA applied in Ericsson Hungary • MDA related activities since beginning of 2002 • Technology evaluation projects • Development of a C++ code generator – SNMP capabilities (network configuration protocol) – CORBA notification service – Trace, debug capabilities • Development of 2 sub-systems of a 3 G mgmt. System – 90% of code was generated! • Common service domains (XML, Logging, etc. ) • TTCN test bed, XMI export, HTML doc. generator, etc. Software Technology Forum Meta-model based system design 2004 -11 -08
Today’s software design • Productivity problems – Labor intensive – Rework • Portability problems – Emerging technologies – Heterogeneous implementation techniques • Maintenance problems • Quality problems • Changing requirements Software Technology Forum Meta-model based system design 2004 -11 -08
Traditional software development life cycle Requirements Text Analysis Text and diagrams Design Text and diagrams Coding Code Testing Software Technology Forum Meta-model based system design 2004 -11 -08
Traditional software development life cycle – Productivity problems • Tedious programming tasks • Late feedback Requirements Text – Portability problems • Non-formalized analysis • Design and Analysis are not separated • Decisions are made in coding – f the Maintenance 0% o -7 6 • 0 Shortcuts get in bud ing! cod Analysis Text and diagrams Design Text and diagrams • Documentation overhead – Quality problems • Non-formalized knowledge in heads Coding Code Testing Software Technology Forum Meta-model based system design 2004 -11 -08
Way of writing specifications • Textual specification – – ambiguous difficult to verify difficult to keep up-to-date “we will sort it out during the design” • Graphical specifications – no semantic meaning defined – undefined relations between diagram types – difficult to verify Software Technology Forum Meta-model based system design 2004 -11 -08
Expectations • • • ? W O Formalized way of specification Early verification and testing Separate business logic analysis and implementation Software reuse Leverage the initial investment in an early phase H Software Technology Forum Meta-model based system design 2004 -11 -08
Analysis and Design • Analysis – Defines what to do; application business logic – Captures requirements and functional decisions in a platform independent manner – Results in a Platform Independent Model (PIM) • Design – – Defines how to do Captures characteristic and interface requirements Defines a specific platform (e. g. C++, Solaris, . NET, J 2 EE) Results in a Platform Specific Model (PSM) Software Technology Forum Meta-model based system design 2004 -11 -08
PIM and PSM • PIM (Platform Independent Model) Expresses only business functionality and behavior Director 1 directed by 0. . * directs Movie 0. . * acts in 0. . * played by Actor • PSM (Platform Specific Model) Defines also technology-specific details e. g. Chained list, index tables Software Technology Forum Meta-model based system design 2004 -11 -08
MDA software development life cycle Requirements Text Analysis PIM Design PSM Coding Code Testing Software Technology Forum Meta-model based system design 2004 -11 -08
What is Model Driven Architecture? • • • MDA is an object-oriented software development method Splits platform independent and platform specific decision Holds decisions in models instead of documents Based on Unified Modeling Language 2 approaches: – Elaboration (model refinement) – Translation • CASE tools that support software life-cycle Software Technology Forum Meta-model based system design 2004 -11 -08
Elaboration approach • Elaborationist approach – middleware independence, an open, vendor neutral approach for interoperability – Booch, Rumbaugh and Jacobsen with UML – OMG, Rational – profiles PIM • Translationist approach – – PSM Code platform independence Steve Mellor and Sally Shlaer meta-model based tools x. UML Software Technology Forum Meta-model based system design 2004 -11 -08
Elaboration approach Modeling structure (classes, attributes & associations) Aids : Use Case Diagramming Sequence Diagramming Collaboration Diagramming Modeling behavior (FSMs) Step 1 : During ‘analysis’, construct a model of the user application Software Technology Forum Meta-model based system design 2004 -11 -08
Elaboration approach … elaborate the model Step 2: During ‘design’, add control structures, data structures, GUI concepts, tasking mechanisms etc. Software Technology Forum Meta-model based system design 2004 -11 -08
Elaboration approach e. g. C++ header files (. h) Step 3 : Automated code generation converts structural model elements to target language Software Technology Forum Meta-model based system design 2004 -11 -08
Elaboration approach e. g. C++ program files (. cpp) Step 4 : Behavioral code is added manually, introducing model and code maintenance management demands. Software Technology Forum Meta-model based system design 2004 -11 -08
Problems of elaboration approach • • PSM is an extended PIM New model elements are sprinkled into the PIM Some model elements removed, merged or split apart Destroys the original PIM Platform specific elements may seep into PIM Boundary between PIM and PSM is fuzzy It often needs reverse engineering Software Technology Forum Meta-model based system design 2004 -11 -08
Platform independent models using MDA • Elaborationist view – middleware independence, an open, vendor neutral approach for interoperability – Booch, Rumbaugh and Jacobsen with UML – OMG, Rational – profiles • Translationist view – – platform independence Steve Mellor and Sally Shlaer meta-model based tools x. UML Software Technology Forum PIM Code PSM Meta-model based system design 2004 -11 -08
How does translation work? • OOA models can be simulated before implementation • OOA models are translated by Model Compilers Characteristic and platform specific Requirements Simulator OOA Model Translator Source Code Functional Requirements Test Cases Software Technology Forum Meta-model based system design Test Suits 2004 -11 -08
Meta-modeling concept • The “meta” prefix – indicates one level of abstraction higher than root – is used in a relative manner • A meta-model is a model of a model • The concept can be recursively applied to itself – a meta-model is a model of a meta-model – a meta-meta-model is a model of a meta-model … • Meta-models are often defined for specific technology domains • OMG is now using M 0 -M 3 notation for modeling Software Technology Forum Meta-model based system design 2004 -11 -08
Meta layers M 0 : User Objects {“Pulp Fiction”, 1994, “Quentin Tarantino”} {“Peter Smith”, 2004. 12. 23} Populates M 1 : Model Defines Director, Actor, Movie Populates M 2 : Meta-model Defines Class, Attribute, Association Populates M 3 : Meta-model Software Technology Forum Defines MOF: : Class, MOF: : Attribute Meta-model based system design 2004 -11 -08
Self recursive description • Concepts: M 2 (DSL) – Class – Attribute – Relationship M 3 Attribute Class 0. . * • name Software Technology Forum 1 0. . * Relationship 1 • name • description 1 0. . * Meta-model based system design • side A multiplicity • side B multiplicity 2004 -11 -08
Potential of meta-modeling • Help others understand the problem domain by using the same language • Define a vocabulary for the elements in the problem domain • Manage complexity by raising the level of abstraction at which we think and design • Enables to develop solid knowledge-base in centralized model repositories Software Technology Forum Meta-model based system design 2004 -11 -08
Model translation How does PIM meta-model describes a system? Domain Class Attribute del State Transition -mo eta Attribute Operation Constructor What is the system architecture ? Destructor What are the characteristic requirements ? Active_alarm actor_ID Client ta-m me Function C++ Actor del o Parameter Class IM m P AMD domain How does C++ meta-model describes a system? alarm_ID problem_cause. . . IP_address IM P What is the task? To create an. Network_element application alarm handling client_ID acknowledge cease_alarm factory IP_address ne_ID create_alarm cease_alarm factory Software Technology Forum Meta-model based system design 2004 -11 -08
Model translation How does PIM meta-model describes a system? Domain ated del pul -mo po ta me PIM Class State Actor Active Client alarm Network element AMD Transition Operation Attribute actor_ID alarm ID client ID IP address problem cause ne ID acknowledge create alarm cease alarm IP address factory AMD domain How does C++ meta-model describes a system? Actor Parameter Class Function Constructor What is the system architecture ? Destructor What are the characteristic requirements ? Active_alarm actor_ID Attribute alarm_ID problem_cause. . . IP_address Client Network_element client_ID IP_address ne_ID acknowledge cease_alarm factory create_alarm cease_alarm factory Software Technology Forum Meta-model based system design 2004 -11 -08
Model translation How does PIM meta-model describes a system? Domain Class State AMD Actor Active Client alarm Network element Attribute Transition AMD Attribute Operation Class Model Translation actor_ID alarm ID client ID IP address problem cause ne ID acknowledge create alarm cease alarm Parameter Actor Active Client alarm Network element Constructor What is the system architecture ? IP address factory AMD domain How does C++ meta-model describes a system? Actor acknowledge create alarm cease alarm actor_ID alarm ID client ID IP address Destructor problem cause ne ID What are the charac. IP address requirements ? factory teristic factory Active_alarm actor_ID Function alarm_ID problem_cause. . . IP_address Client Network_element client_ID IP_address ne_ID acknowledge cease_alarm factory create_alarm cease_alarm factory Software Technology Forum Meta-model based system design 2004 -11 -08
Model translation How does PIM meta-model describes a system? Domain Class State AMD Actor Active Client alarm Network element Operation Attribute Transition Attribute cease alarm Function Model Translation Constructor What is the system architecture ? IP address factory Parameter Class actor_ID alarm ID client ID IP address problem cause ne ID acknowledge create alarm AMD domain How does C++ meta-model describes a system? Destructor What are the characteristic requirements ? C++ source code Actor Active_alarm actor_ID alarm_ID problem_cause. . . IP_address Client Network_element client_ID IP_address ne_ID acknowledge cease_alarm factory create_alarm cease_alarm factory Software Technology Forum Meta-model based system design 2004 -11 -08
Translation process PIM M-M Defined mapping PSM M-M Defined mapping Generates Populates PIM PSI M-M Applied mapping Software Technology Forum PSM Applied mapping Meta-model based system design PSI get Tar e Cod 2004 -11 -08
Benefits of translation approach • • • Early verification and testing Separates business logic analysis and implementation Software reuse PSM and PIM are independently maintained Leverage the initial investment in an early phase Software Technology Forum Meta-model based system design 2004 -11 -08
Platform independent business logic App 2 App 1 App 3 Model Compiler for Platform v 1 App 3 App 2 Software Technology Forum Meta-model based system design 2004 -11 -08
Platform independent business logic App 2 App 1 App 3 Model Compiler for Platform v 2 Platform v 1 App 3 App 2 Software Technology Forum Platform v 2 App 1 App 3 App 2 Meta-model based system design 2004 -11 -08
Potential of model translation • Code generation is just one possibility • Architectures can be used for: – – – Document generation Model verification Model simulation KPI measurements Building architectures Software Technology Forum Meta-model based system design 2004 -11 -08
Model translation techniques • Template based translation – Source code templates extended with model queries • Model based translation specified with – – ASL QVT XSLT some other query language • Code generation can be preceded by several model-tomodel translations Software Technology Forum Meta-model based system design 2004 -11 -08
Traditional software development life cycle – Productivity problems • Tedious programming tasks • Late feedback Requirements Text – Portability problems • Non-formalized analysis • Design and Analysis are not separated • Decisions are made in coding – Maintenance • Shortcuts • Documentation overhead – Quality problems • Non-formalized knowledge in heads Analysis Text and diagrams Design Text and diagrams Coding Code Testing Software Technology Forum Meta-model based system design 2004 -11 -08
MDA software development life cycle – Productivity problems • Keeping intellectual property in models and architectures • Automated code generation • Early verification – Portability problems • Splitting platform specific and platform independent decisions – Maintenance • Strict forward engineering technique • Documents and code are generated • No data redundancy – Quality • Uniform code quality • Early verification Requirements Text Analysis PIM Design PSM Coding Code Testing Software Technology Forum Meta-model based system design 2004 -11 -08
Project timelines Kick-off MS 1 Kick-off MS 3 MS 2 A & O od el O t D od e te st in g t m oy pl De MS 4 C M O MS 4 MS 3 MS 2 O R an equ al ir ys em is e n T ve est rif & ic at io ng di Co MS 1 en n Pr tio ot na De oty l s si pin pec gn g s do cu m en ta Fu nc R an equ al ire ys m is en t tio n Traditional D Te ge ne st & ra tio n ep l ve r oy m ifi ca tio n MDA Software Technology Forum Meta-model based system design 2004 -11 -08 en t
Activity distribution of an MDA project Other activities 11% Testing 12% Analysis 49% Implementation 28% Software Technology Forum Meta-model based system design 2004 -11 -08
Trend diagram of an MDA project 160 Analysis 120 Implementation 100 MHR 140 Testing 80 60 40 20 38 36 33 31 28 26 24 22 20 18 16 14 12 10 8 6 3 0 Week Software Technology Forum Meta-model based system design 2004 -11 -08
KPI comparison of “traditional” and MDA proj. Traditional MDA Implemented requirements 48 % 83 % Not implemented requirements 52 % 18 % Cost (mhrs) 6800 3440 0 12 37 7 0 2 Analysis TRs Implementation TRs Architecture TRs Software Technology Forum Meta-model based system design 2004 -11 -08
Experiences • MDA is not a “silver button”. Doesn’t solve anything from itself… • …but offers a strict process with technology support • Using iterations. At feedback every affected part is modified • Sometimes difficult to decide between architecture and application modeling • Loosely connected areas (requirements, legacy codes) are hard to keep consistent • Model tests replaces basic and function tests (partly) Software Technology Forum Meta-model based system design 2004 -11 -08
Effects on the organization • Introduction of new technology needs initial investment – Time and money – Gradual technology shift • • Fear and resistance from management side Strong resistance from sw. developer side High expectations Balance of employees’ competence portfolio must change Software Technology Forum Meta-model based system design 2004 -11 -08
Conclusion • • • It works! Doesn’t solve everything Reduces budget and time-to-market significantly Offers uniform quality (for generated part) Replaces textual documentation Can keep different areas consistent but it’s not trivial – – Requirement analysis Sw analysis, design and implementation Testing Quality measurements, project tracking Software Technology Forum Meta-model based system design 2004 -11 -08
Questions ? Software Technology Forum Meta-model based system design 2004 -11 -08
57986e4ac23950368d505d82dca64385.ppt