
Brief Introduction to UML 2.0 (for SEG seminar) Tian Zhang Nanjing University,China October 2005 Outline Part I : Background Process of UML 2.0 adoption Part II: Overview of UML 2.0 Superstructure Tian Zhang @ Nanjing University 2 Part I OMG's technology adoption process UML 1.4, 1.5, 2.0 UML 2.0 in MDA The current status of UML 2.0 Tian Zhang @ Nanjing University 3 OMG's Technology Adoption Process 1. Optional RFI stage OMG在1999年提出UML的修订信息需求 来自不同领域的26个响应者大多数提议进行重大修订 2. TF issues RFP, evaluates submissions OMG于2000年初发布UML2.0的四部分提案需求 3. Voting to Adopt an OMG specification 4. Finalization - getting ready for prime time 今年10月通过了Superstructure的最终正式版 其余部分仍处于最终修改版阶段 5. The OMG specification maintenance Cycle 6. Retiring Obsolete Specifications Tian Zhang @ Nanjing University 4 UML 2.0 RFPs Superstructure Diagram Interchange Defines user-level constructs to specify structure and behavior of systems (e.g., class diagrams, sequence diagrams) Infrastructure OCL Defines basic constructs to specify UML and to customize it for specific domains (e.g., real-time) Tian Zhang @ Nanjing University 5 UML 2.0 Infrastructure设计目标 定义一个元语言的核心 – 基础结构库(Infra- structureLibrary)通过对此核心的复用,除了 可以定义一个自展的UML元模型之外,还可以 定义其他元模型,包括MOF和CWM; 通过共用核心包,UML和MOF、CWM在体系 结构上保持一致。 Tian Zhang @ Nanjing University 6 Goals of UML 2.0 Superstructure Restructure and refine the language to make it easier to apply, implement and customize Improve support for component-based development specify both platform-independent components (e.g., business components) and platform-specific components (e.g., EJB, COM+) Refine architectural specification capabilities support hierarchical composition of parts with interfaces (compare SDL blocks and processes) Increase the scalability, precision and integration of behavioral diagrams augment sequence diagrams with advanced constructs from MSCs that can be combined and integrated with other behavior update state machines diagrams to make generalizable and able to support a transition-centric view revise activity diagrams to support more flexible parallelism and furnish more I/O options support executable models Review all UML 1.x constructs and diagrams Tian Zhang @ Nanjing University 7 UML 2.0 Superstructure 设计目标 严格地复用Infrastructure中的模型构造物; 既可以描述平台无关构件(如业务构件),也可以描 述平台相关构件(如EJB,COM+等),提高对基于 构件开发和MDA的支持; 支持接口、部件和连接子,及其层次化组合能力,从 而提高对架构的规约能力; 增强行为图的可伸缩性、精确性和集成能力; 支持可执行模型; 审定所有UML1.x的构造物和图,适当地精化、取缔 和逐步淘汰。 Tian Zhang @ Nanjing University 8 UML 2.0, The Current Official Version: UML 2.0 Superstructure formal/05-07-04 is complete - stable since it took its adopted form in October, 2004. UML 2.0 Infrastructure ptc/04-10-14 UML 2.0 Diagram Interchange ptc/05-06-04 UML 2.0 OCL ptc/05-06-06 Pages Statistic Infrastructure : 226 pages Superstructure : 709 pages Diagram Interchange : 82 pages OCL : 185 pages Tian Zhang @ Nanjing University 9 UML 2.0 in MDA MDA的核心规范: • Meta Object Facility • MOF current version 1.4 • Unified Modeling Language • UML current version 1.5 • Common Warehouse Metamodel • CWM current version 1.0 • XML Metadata Interchange • XMI current version 2.1 Tian Zhang @ Nanjing University 10 The Role of UML & MOF in The MDA The following was approved unanimously by 17 participants at the ORMSC: Any modeling language used in MDA must be described in terms of the MOF language, to enable the metadata to be understood in a standard manner, which is a precondition for any ability to perform automated transformations. ORMSC plenary session August 26, 2004 Tian Zhang @ Nanjing University 11 Part II UML 2.0 Superstructure Specification Thirteen diagrams in UML 2.0 Tian Zhang @ Nanjing University 12 UML 2.0 Superstructure UML 1.5 formal/03-03-01 Part I: Structure 1. UML Summary Classes 2. UML Semantics Components Part 1 - Background Composite Structures Part 2 - Foundation Part 3 - Behavioral Elements Deployments Part 4 - General Mechanisms Part II: Behavior Part 5 - Actions Actions 3. UML Notation Guide Activities Part 1 - Background Common Behaviors Part 2 - Diagram Elements Interactions Part 3 – Model Management State Machines Part 4 - General Extension Mechanisms Use Cases Part 5 - Static Structure Diagrams Part III: Supplement Part 6 - Use Case Diagrams Auxiliary Constructs Part 7 - Interaction Diagrams Profiles Part 8 - Collaboration Diagrams Part IV – Annexes Part 9 - Statechart Diagrams A - Diagrams Part 10 - Activity Diagrams B - UML Keywords 4. UML Example Profiles C - Standard Stereotypes 5. UML Model Interchange Tian Zhang @ Nanjing University 13 Language Units The modeling concepts of UML are grouped into language units. For example, the State Machines language unit enables modelers to specify discrete event-driven behavior using a variant of the well-known statecharts formalism. Two benefits : easy to learn and use easy to define compliance levels Tian Zhang @ Nanjing University 14 Compliance Levels Level 0 (L0) - This level is formally defined in the UML Infrastructure. Level 1 (L1) - It adds language units for use cases, interactions, structures, actions, and activities. Level 2 (L2) - It adds language units for deployment, state machine modeling, and profiles. Level 3 (L3) - This level represents the complete UML. Tian Zhang @ Nanjing University 15 Diagrams in UML 2.0 与UML1.x相比,UML 2.0将结构元素和行为元素结合 起来建模的能力大大增强; UML 2.0支持13种图(UML 1.x支持9种图); Class Diagram Activity Diagram Composite Structure Diagram Communication Diagram Component Diagram Interaction Overview Diagram Deployment diagram State Machine Diagram Object Diagram Sequence Diagram Package Diagram Timing Diagram Use Case Diagram Tian Zhang @ Nanjing University 16 Tian Zhang @ Nanjing University 17 Changes from 1.x Add four diagrams; Renamed two diagrams: 原来的协作图(Collaboration Diagrams)改名为通讯图 (Communication Diagrams) ,但语义并没有丰富到与 顺序图等价的地步; 原来的状态图(Statechart Diagrams)改名为状态机图 (State Machine Diagrams),解决了1.x中状态图和状态 机的语义重叠、模糊不清的问题。 Tian Zhang @ Nanjing University 18 Thirteen diagrams in UML 2.0 Structure Diagram Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Behavior Diagram Activity Diagram Use Case Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram Tian Zhang @ Nanjing University 19 Composite Structure Diagram One of the most significant new features in UML 2 is the ability to hierarchically decompose a class into an internal structure. This allows you to take a complex object and break it down into parts The core constructs of Composite Structures are: Part Connector Port Tian Zhang @ Nanjing University 20 Example 1 – TV (1) Fig. 1. Two ways of showing a TV viewer and its interfaces Tian Zhang @ Nanjing University 21 Example 1 – TV (2) 内部结构表示出一个类 如何在内部分解成两部 分以及哪些部分支持并 需要哪些不同接口。 该图说明了每一个TV 观众包含一个控制部分 和一个发生器部分。 Fig. 2. Internal view of a component (example suggested by Jim Rumbaugh) Tian Zhang @ Nanjing University 22 Example 1 – TV (3) Fig. 3. A component with multiple ports You can add ports to the external structure ports allow you to group the required and provided interfaces to show logical interactions that a component has with the outside world Tian Zhang @ Nanjing University 23 When to Use Composite Structures Compare with Packages packages are a compile-time grouping composite structures show runtime groupings Natural fit for showing components and how they are broken into parts Much of this notation is used in component diagrams (Martin Flower). Tian Zhang @ Nanjing University 24 Thirteen diagrams in UML 2.0 Structure Diagram Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Behavior Diagram Activity Diagram Use Case Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram Tian Zhang @ Nanjing University 25 Package Diagrams A package is a grouping construct that allows you to take any construct in the UML and group its elements together into higher-level units Each package represents a namespace Use double colons to show package names in UML System::Date Subsystem::Util::Date Tian Zhang @ Nanjing University 26 Packages and Dependencies Fig. 4. Package diagram for an enterprise application Tian Zhang @ Nanjing University 27 Implementing Packages Fig. 5. A package implemented by other packages It's quite common for an interface and its implementation to be in separate packages Tian Zhang @ Nanjing University 28 Implementing Packages This is an example of the pattern Separated Interface. Fig. 6. Defining a required interface in a client package Tian Zhang @ Nanjing University 29 Thirteen diagrams in UML 2.0 Structure Diagram Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Behavior Diagram Activity Diagram Use Case Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram Tian Zhang @ Nanjing University 30 Behavior Diagrams Part II: Behavior 11. Actions 12. Activities 13. Common Behaviors 14. Interactions 15. State Machines 16. Use Cases (cite in Table of Contents) Tian Zhang @ Nanjing University 31 The UML packages that support behavioral modeling, along with the structure packages they depend upon (CompositeStructures and Classes) are shown in the figure above. Tian Zhang @ Nanjing University 32 Thirteen diagrams in UML 2.0 Structure Diagram Class
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages91 Page
-
File Size-