IBM Software Group Rational Software France Object Oriented
® IBM Software Group Rational Software France Object Oriented Analysis and Design with UML 2 and Rational Software Modeler PART I – The Unified Modeling Language (UML 2) © 2006 IBM Corporation
IBM Software Group | Rational software Table of Contents 00. Introduction p. 03 01. Concepts of Object Orientation p. 09 02. Objects, Classes and Interactions p. 27 03. Classes, Relationships and Packages p. 55 04. Other UML Diagrams p. 89 2
® IBM Software Group Rational Software France Object Oriented Analysis and Design with UML 2 and Rational Software Modeler 00. Introduction © 2006 IBM Corporation
IBM Software Group | Rational software Introductions § Your organization § Your role § Your background, experience 4 Object technology experience 4 Software development experience § Your expectations for this course 4
IBM Software Group | Rational software Course Objectives § Understand the concepts of Object Orientation § Capture system requirements with use cases § Identify classes, objects and relations, and creating interaction diagrams and class diagrams § Build an analysis model with analysis classes § Understand Model Driven Development (MDD) and Model Driven Architecture (MDA) § Apply a use case driven, architecture centered and iterative process to build a robust design model 5
IBM Software Group | Rational software Agenda § Day 1: 4 UML 2 § Day 2: 4 Object Oriented Analysis (OOA) § Day 3: 4 Object Oriented Analysis (OOA) (cont. ) 4 Object Oriented Design (OOD) § Day 4: 4 Object Oriented Design (OOD) (cont. ) § The labs for days 2 to 4 will be based on IBM Rational Software Modeler 7 or above 6
IBM Software Group | Rational software Logistics Morning 1 Fifteen minute break Lunch 1 Hour Afternoon 1 Fifteen minute break 7
IBM Software Group | Rational software 8
® IBM Software Group Rational Software France Object Oriented Analysis and Design with UML 2 and Rational Software Modeler 01. Concepts of Object-Orientation © 2006 IBM Corporation
IBM Software Group | Rational software Where Are We? § What is Modeling? § Principles of Object Orientation § The Unified Modeling Language 10
IBM Software Group | Rational software What is a Model? § A model is a simplification of reality § Modeling achieves four aims: 4 Helps you to visualize a system as you want it to be 4 Permits you to specify the structure or behavior of a system 4 Gives you a template that guides you in constructing a system 4 Documents the decisions you have made § You build models of complex systems because you cannot comprehend such a system in its entirety § You build models to better understand the system you are developing 11
IBM Software Group | Rational software Principles of Visual Modeling § The model you create influences how the problem is attacked § Every model may be expressed at different levels of precision § The best models are connected to reality § No single model is sufficient 12
IBM Software Group | Rational software Model Driven Development § A natural evolution of object oriented technologies § The encapsulation of business logic in (UML) models § The use of these models to automate the development of applications, code generation, testing and maintenance ? ? 13
IBM Software Group | Rational software Model Driven Architecture (MDA) § An architectural style http: //www. omg. com/ § An OMG initiative 14
IBM Software Group | Rational software Where Are We? § What is Modeling? § Principles of Object Orientation § The Unified Modeling Language 15
IBM Software Group | Rational software Basic Principles of Object Orientation § Abstraction § Encapsulation § Modularity § Hierarchy 16
IBM Software Group | Rational software What Is Abstraction? § The essential characteristics of an entity that distinguishes it from all other kinds of entities § Depends on the perspective of the viewer § Is not a concrete manifestation, denotes the ideal essence of something From Object-Oriented Analysis and Design with Applications by Grady Booch, 1994 17
IBM Software Group | Rational software What Is Encapsulation? § Hides implementation from clients 4 Clients depend on interface 4 Improves the resiliency of the system, i. e. its ability to adapt to change From Object-Oriented Analysis and Design with Applications by Grady Booch , 1994 18
IBM Software Group | Rational software What Is Modularity? § Breaks up something complex into manageable pieces. § Helps people understand complex systems From Object-Oriented Analysis and Design with Applications by Grady Booch , 1994 19
IBM Software Group | Rational software What Is Hierarchy? Increasing abstraction Asset Bank. Account Decreasing abstraction Savings Checking Security Stock Real. Estate Bond Elements at the same level of the hierarchy should be at the same level of abstraction 20
IBM Software Group | Rational software Where Are We? § What is Modeling? § Principles of Object Orientation § The Unified Modeling Language 21
IBM Software Group | Rational software What Is the UML? § The UML is a language for § Visualizing § Specifying § Constructing § Documenting the artifacts of a software intensive system 22
IBM Software Group | Rational software UML Covers All Aspects of Software Development § The UML addresses system architecture, requirements, tests, project planning, and release management Use Case Diagram Deployment Diagram ºÐ» ê ȯ°æÀÇ Çϵå¿þ¾î¹× ³×Æ®¿÷À¸·ÎÀÇ Á¤º¸ ½Ã½ºÅÛ ¿¬°á ¸ðµ¨ À©µµ¿ì 95 : Ŭ¶óÀ̾ðÆ® À©µµ¿ì NT: ÀÀ¿ë¼ ¹ö À¯´Ð½º ¸Ó½Å: ÀÀ¿ë ¼ ¹ö ¹× µ¥ÀÌŸ ¼ ¹ö, Åë½Å ¼ ¹ö IBM ¸ÞÀÎÇÁ·¹ÀÓ: µ¥ÀÌŸ ¼ ¹ö, Åë½Å ¼ ¹ö Windows 95 Use Case 1 ¹®¼ °ü¸® Ŭ¶óÀ̾ðÆ®. EXE ¹®¼ °ü¸® ¾ÖÇø´ Windows NT Actor A Actor B Use Case 2 Solaris ¹®¼ °ü¸® ¿£Áø. EXE Alpha UNIX ÀÀ¿ë¼ ¹ö. EXE Windows NT IBM Use Case 3 Mainframe µ¥ÀÌŸº£À̽º¼ ¹ö Document. List main. Wnd file. Mgr : document : File. Mgr Document g. File repository Document user File. Mgr add( ) name : int delete( ) fetch. Doc( ) docid : int sort. By. Name( ) num. Field : int get( ) 1: Doc view request ( ) ƯÁ¤¹®¼ ¿¡ ´ëÇÑ º¸±â¸¦ » ç¿ëÀÚ°¡ ¿äû ÇÑ´Ù. open( ) close( ) 2: fetch. Doc( ) read() fill the code. . read( ) File. List sort. File. List( ) f. List create( ) 3: create ( ) fill. Document( ) add( ) delete( ) 1 4: create ( ) 5: read. Doc ( ) È ÀÏ°ü¸®ÀÚ´ ÀÐ¾î¿ 6: fill. Document ( ) ¹®¼ ÀÇ Á¤º¸¸¦ÇØ´ç ¹®¼ °´Ã¼¿¡ ¼³Á¤À» ¿äû ÇÑ´Ù. rep 7: read. File ( ) File Repository 8: fill. File ( ) (from Persistence) read( ) È ¸é°´Ã¼´ ÀоîµéÀÎ 9: sort. By. Name ( ) Grp. File name : char * = 0 °´Ã¼µé¿¡ ´ëÇØ À̸§º°·Î Á¤·ÄÀ» ½ÃÄÑÈ ¸é¿¡ º¸¿©ÁØ´Ù. read. Doc( ) read. File( ) read( ) open( ) create( ) fill. File( ) Sequence Diagram Class Diagram 23
IBM Software Group | Rational software History of the UML 2. 0 (2004) UML 1. 5 (March, ‘ 03) Current version = 2. 1 UML 1. 1 (Sept. ‘ 97) UML 1. 0 (Jan. ‘ 97) UML 0. 9 and UML 0. 91 (June ‘ 96) (Oct. ‘ 96) Unified Method 0. 8 (OOPSLA ’ 95) Booch ’ 93 OOSE Other Methods Booch ‘ 91 OMT 2 OMT 1 24
IBM Software Group | Rational software A Language Is Not Enough to Build a System Team- Based Development Modeling Language Unified Process 25
IBM Software Group | Rational software 26
® IBM Software Group Rational Software France Object Oriented Analysis and Design with UML 2 and Rational Software Modeler 02. Objects, Classes and Interactions © 2006 IBM Corporation
IBM Software Group | Rational software Where Are We? § What is an Object? § What is a Class? § Interaction Diagrams § Sequence Diagrams § Communication Diagrams 28
IBM Software Group | Rational software What Is an Object? § Informally, an object represents an entity, either physical, conceptual, or software 4 Physical entity Truck 4 Conceptual entity Chemical Process 4 Software entity Linked List 29
IBM Software Group | Rational software A More Formal Definition Attributes § An object is an entity with a well defined boundary and identity that encapsulates state and behavior s( Gr ad e it. F in al bm Su 4 Behavior is represented by operations, methods, and state machines ) 4 State is represented by attributes and relationships Ac ce pt Co ur se Of fe rin g( ) () ad Lo ax t. M Se Name: J Clark Employee ID: 567138 Hire. Date: 07/25/1991 Status: Tenured Discipline: Finance Max. Load: 3 Take. Sabbatical() Object “Professor Clark” Operations 30
IBM Software Group | Rational software Objects and Encapsulation § Encapsulation: Professor Clark 4 Protects the supplier object from incorrect use by clients s( ) Ac pt Co ur se bm it. F in al G ra de 4 Protects the clients from implementation changes in the supplier ce Name: J Clark Of fer ing () Su Employee ID: 567138 Hire. Date: 07/25/1991 Status: Tenured Se Discipline: Finance a t. M Set. Max. Load(4) Max. Load: 4 () ad o x. L Take. Sabbatical() 31
IBM Software Group | Rational software Where Are We? § What is an Object? § What is a Class? § Interaction Diagrams § Sequence Diagrams § Communication Diagrams 32
IBM Software Group | Rational software What Is a Class? § A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics 4 An object is an instance of a class § A class is an abstraction in that it 4 Emphasizes relevant characteristics 4 Suppresses other characteristics 33
IBM Software Group | Rational software A Sample Class Course Attributes Behavior Name Location Days offered Credit hours Start time End time Add a student Delete a student Get course roster Determine if it is full 34
IBM Software Group | Rational software Representing Classes in UML § A class is represented using a rectangle often with three compartments: 4 The class name § It should be a simple name and it should reflect exactly what the class is and does 4 The structure (attributes) 4 The behavior (operations) Visibility + = public = private 35
IBM Software Group | Rational software Representing Classes in UML (cont. ) § Style Guidelines 4 Capitalize the first letter of class names 4 Begin attribute and operation names with a lowercase letter § Compartments 4 Only the name compartment is mandatory 4 Additional compartments may be supplied to show other properties Representation with the attribute compartment suppressed, operation visibility shown as “decoration”, and the operation compartment filtered to show only two operations 36
IBM Software Group | Rational software The Relationship between Classes and Objects § A class is an abstract definition of an object 4 It defines the structure and behavior of each object in the class 4 It serves as a template for creating objects. § Classes are not collections of objects Slot compartment 37
IBM Software Group | Rational software Where Are We? § What is an Object? § What is a Class? § Interaction Diagrams § Sequence Diagrams § Communication Diagrams 38
IBM Software Group | Rational software UML Diagrams § UML diagrams contain graphical elements (nodes connected by paths) that represent elements in the UML model 4 Each diagram has a contents area 4 As an option, it may have a frame and a heading as shown on the right § Two main types 4 Structure Diagrams show the static structure of the objects in a system 4 Behavior Diagrams show the dynamic behavior of the objects 4 A complete taxonomy of UML diagrams is provided in chapter 4 39
IBM Software Group | Rational software What is an Interaction Diagram? § Generic term that applies to several behavior type diagrams that emphasize object interactions 4 Sequence Diagram (the most common variant) 4 Communication Diagram 4 Specialized Variants § Timing Diagram § Interaction Overview Diagram 40
IBM Software Group | Rational software Objects Need to Collaborate § Objects are useless unless they can collaborate to solve a problem 4 Each object is responsible for its own behavior and status 4 No one object can carry out every responsibility on its own § How do objects interact with each other? 4 They interact through messages § A client object sends a message to a supplier object to perform some activity 41
IBM Software Group | Rational software Interaction Diagrams § Sequence Diagram 4 Time oriented view of object interaction § Communication Diagram Sequence Diagrams 4 Structural view of messaging objects Communication Diagrams 42
IBM Software Group | Rational software Interaction Diagrams § Timing Diagram 4 Time constraint view of messages involved in an interaction Timing Diagrams § Interaction Overview Diagram 4 High level view of interaction sets combined into logic sequence Interaction Overview Diagrams 43
IBM Software Group | Rational software Where Are We? § What is an Object? § What is a Class? § Interaction Diagrams § Sequence Diagrams § Communication Diagrams 44
IBM Software Group | Rational software What Is a Sequence Diagram? § A sequence diagram is an interaction diagram that emphasizes the time ordering of messages § The diagram shows: 4 The objects participating in the interaction 4 The sequence of messages exchanged Sequence Diagrams 45
IBM Software Group | Rational software Example Unnamed (anonymous) object Message Reflexive message Return message Execution specification Lifeline 46
IBM Software Group | Rational software Message Types § Synchronous message 4 Call to an operation § Asynchronous message 4 Asynchronous call to an operation 4 Asynchronous send action of a signal § Create Message § Delete Message § Reply message to an operation call 47
IBM Software Group | Rational software Interaction Use Interaction use (see next slide) New in UML 2 48
IBM Software Group | Rational software Interaction Use and Combined Fragments New in UML 2 Combined fragments 49
IBM Software Group | Rational software Where Are We? § What is an Object? § What is a Class? § Interaction Diagrams § Sequence Diagrams § Communication Diagrams 50
IBM Software Group | Rational software What Is a Communication Diagram? § A communication diagram emphasizes the organization of the objects that participate in an interaction The communication diagram shows: 4 The objects participating in the interaction 4 Links between the objects 4 Messages passed between the objects Communication Diagrams 51
IBM Software Group | Rational software Example Link 52
IBM Software Group | Rational software Discussion: Communication vs. Sequence Diagrams § In UML 1. x, collaboration diagrams (as they were called) and sequence diagrams were completely equivalent 4 The major difference, which is retained in UML 2. x, is the ability to explicitly show links in collaboration/communication diagrams § In UML 2. x, communication diagrams are much less expressive and precise than sequence diagrams 4 Communication diagrams have lost some expressiveness while sequence diagrams were significantly improved 4 UML 2. 1 define communication diagrams as “simple Sequence Diagrams that use none of the structuring mechanisms such as Interaction. Uses and Combined. Fragments” 4 It is possible that communication diagrams will eventually fall out of use 53
IBM Software Group | Rational software Exercise § Perform the exercise provided by the instructor 54
® IBM Software Group Rational Software France Object Oriented Analysis and Design with UML 2 and Rational Software Modeler 03. Classes, Relationships and Packages © 2006 IBM Corporation
IBM Software Group | Rational software Where Are We? § Associations § Dependencies § Generalizations § Packages § Miscellaneous Topics 56
IBM Software Group | Rational software Classes Collaborate § Objects collaborate with each other by sending messages 4 To send a message to an object, the client object must have a link with the supplier § If there is a link between two objects, there must be some kind of relationship between the corresponding classes: 4 The relationship may be a structural relationship: association and its variants (aggregation, composition) 4 Or a non structural relationship, called a dependency 57
IBM Software Group | Rational software What Is an Association? § The semantic relationship between two or more classifiers that specifies connections among their instances § A structural relationship specifying that objects of one thing are connected to objects of another thing 58
IBM Software Group | Rational software What is Navigability? § Navigability indicates that it is possible to navigate from one class to another (or more precisely from one instance of a class to another instance of the same class or of another class) 4 Associations are bi directional by default 4 An association with an arrow is a one way association § The client class can navigate to the supplier class, but not the other way around Association navigable from Registration. Controller to Schedule Association navigable in both directions 59
IBM Software Group | Rational software Naming Associations § To clarify its meaning, an association can be named § The name is represented by a label as shown below § Usually a verb or an expression starting with a verb 60
IBM Software Group | Rational software Association Roles § A role name specifies the role that a class plays in its relationship with another class § Role names are typically names or noun phrases § A role name is placed near the association next to the class to which it applies (as a role) 4 Each association end may be named 61
IBM Software Group | Rational software What Is Multiplicity? § Multiplicity is the number of instances one class relates to ONE instance of another class § For each association, there are two multiplicity decisions to make, one for each end of the association 4 For each instance of Professor, many Course Offerings may be taught 4 For each instance of Course Offering, there may be either one or zero Professor as the instructor 62
IBM Software Group | Rational software Multiplicity Indicators § Unspecified § Exactly one § Zero or more (no upper limit) 1 0. . * * § One or more § Zero or one (optional) § Specific range § Multiple, disjoint ranges 1. . * 0. . 1 2. . 4 2, 4. . 6 63
IBM Software Group | Rational software Example 64
IBM Software Group | Rational software Association Classes § Take the n n relationship between Student and Course § If you have to capture the grade received by a student for a given course, where would you place the grade? On Student? On Course? § The answer is on the association itself by adding an association class, called Result § The association class represents the association of exactly one student and one course 65
IBM Software Group | Rational software Qualified Associations § A qualifier is an attribute of an association whose values partition the set of objects related to an object across an association 4 A qualified association represents a lookup table (which can be implemented as a hash table for instance) § The multiplicity of the target class is often 0. . 1 but it may be 0. . * § Example: 4 In the context of the Work. Desk, you’d have a job. Id that would identify a particular Returned. Item. In that sense, job. Id is an attribute of the association. Then, given an object of type Work. Desk and a particular value for job. Id, you can navigate to 0 or 1 object of type Returned. Item. 66
IBM Software Group | Rational software What Is an Aggregation? § A special form of association that models a whole part relationship between the aggregate (the whole) and its parts 4 An aggregation is an “is a part of” relationship § Multiplicity is represented like other associations 67
IBM Software Group | Rational software What Is a Composition? § A form of aggregation with strong ownership and coincident lifetimes 4 The parts cannot survive the whole/aggregate 68
IBM Software Group | Rational software Example 69
IBM Software Group | Rational software Where Are We? § Associations § Dependencies § Generalizations § Packages § Miscellaneous Topics 70
IBM Software Group | Rational software What Is A Dependency? § A non structural relationship between two classes 4 The client needs access to the services provided by the supplier 4 But doesn’t need to maintain a permanent relationship with the supplier objects (transient relationship) § A dependency may result from: 4 A local declaration within the body of an operation (op 1 below) 4 The supplier appears as a parameter type (op 2 in the example) public class Client { public void op 1() { Supplier local. Var = new Supplier(); … 71
IBM Software Group | Rational software Where Are We? § Associations § Dependencies § Generalizations § Packages § Miscellaneous Topics 72
IBM Software Group | Rational software What Is Generalization? § A relationship among classes where one class shares the structure and/or behavior of one or more classes 4 A subclass inherits parent’s attributes, operations, and relationships 4 A subclass may: § Add additional attributes, operations, relationships § Redefine inherited operations (use caution!) § Defines a hierarchy of abstractions in which a subclass inherits from one or more super classes § Is an “is a kind of” relationship § Single or multiple inheritance 73
IBM Software Group | Rational software Example Superclass, parent or ancestor Subclasses, children or descendants Generalization Relationship 74
IBM Software Group | Rational software What is an Abstract Class? § Abstract classes cannot be instantiated 4 Name in italics § Abstract operations: the subclasses must provide the implementation 4 Name in italics Abstract Class Abstract Operation All objects are either lions or tigers 75
IBM Software Group | Rational software What Is An Interface? § A “contract” between providers and consumers of services 4 Equivalent to an abstract class in which all operations are abstract 4 Provided interfaces: interfaces the element exposes to its environment 4 Required interfaces: interfaces the element requires from other elements 4 Note: UML interfaces can have attributes (not possible for Java interfaces) § The provider of the interface is said to realize the interface Interface Realization Interface New in UML 2 Ball and Socket notation: see module 4 76
IBM Software Group | Rational software What Is Polymorphism? § The ability to hide many different implementations behind a single class or interface Without polymorphism: Shape s = …; If (s instanceof Rectangle) { ((Rectangle) s). draw(); else if (s instanceof Circle) { ((Circle) s). draw(); else if (s instanceof Triangle) { ((Circle) s). draw(); } With polymorphism: Shape s = …; s. draw(); 77
IBM Software Group | Rational software Where Are We? § Associations § Dependencies § Generalizations § Packages § Miscellaneous Topics 78
IBM Software Group | Rational software What Is a Package? § A general purpose mechanism for organizing elements into groups § A model element that can contain other model elements 4 Grouping of logically related elements § A package can be used: 4 To organize the model under development 4 As a unit of configuration management 79
IBM Software Group | Rational software Package Relationships § A package A depends on a package B if there is at least one element from A that depends on at least one element from B Class. A 1 depends on Class. B 1 Dependency (any relationship between two elements implies a dependency and the arrow indicates the direction of the dependency) 80
IBM Software Group | Rational software Where Are We? § Associations § Dependencies § Generalizations § Packages § Miscellaneous Topics 81
IBM Software Group | Rational software What Is A Stereotype? § A stereotype is a mechanism used to extend the vocabulary of UML 4 Represented textually (<<mystereo>>) and/or graphically 4 Any UML element may be stereotyped § Stereotypes are grouped into collections of stereotypes, called profiles § Can be defined for specific domains and/or applications 4 Pre defined or custom § A stereotype may have its own properties 82
IBM Software Group | Rational software More About Element Visibility § public (+) 4 Visible to all elements that can access the contents of the namespace that owns it § private ( ) 4 Only visible inside the namespace that owns it § protected (#) 4 Visible to elements that have a generalization relationship to the namespace that owns it § package (~) 4 Only named elements that are not owned by packages can be marked as having package visibility 4 Any element marked as having package visibility is visible to all elements within the nearest enclosing package 83
IBM Software Group | Rational software Classifier Scope § Determines number of instances of the attribute/operation 4 Instance: one instance for each class instance 4 Classifier: one instance for all class instances § Classifier scope is denoted by underlining the attribute/operation name public static Course. Catalog get. Instance() { 4 “Static” attributes and operations in languages like Java and C++ } And some client code: If (instance == null) { instance = new Course. Catalog(); } return instance; Pattern Singleton Course. Catalog cat = Course. Catalog. get. Instance(); Course. List courses = cat. retrieve. Courses(); 84
IBM Software Group | Rational software Structure Diagrams § Structure Diagrams show the static structure of the objects in a system 4 Class diagrams typically show classes and relationships between classes § Most of the diagrams we have used so far are class diagrams 4 Package diagrams typically show packages and relationships between packages 4 Object diagrams typically show objects (instances of classes) and links between objects (instances of relationships between classes) 4 The other structure diagrams (composite structure, component and deployment are presented in module 4) § There are no strict boundaries between different variations 4 It is possible to display any element you normally display in a given structure diagram in any variation. 85
IBM Software Group | Rational software Object Diagram: Example Object diagrams are often used to conceptualize the more abstract class diagrams by providing “real world” examples of objects and object connections An object diagram also represent a snapshot of the system at a given time, highlighting existing and non existing links: Here boris needs to establish a link with PM to deliver parcel 1 … 86
IBM Software Group | Rational software What Is A Constraint? § A condition or restriction (a Boolean expression) expressed in natural language text or in a machine readable language for the purpose of declaring some of the semantics of an element § Some are predefined in UML (“xor”), others may be user defined § OCL (Object Constraint Language) is a predefined language for writing constraints 87
IBM Software Group | Rational software Exercise § Perform the exercise provided by the instructor 88
® IBM Software Group Rational Software France Object Oriented Analysis and Design with UML 2 and Rational Software Modeler 04. Other UML Diagrams © 2006 IBM Corporation
IBM Software Group | Rational software The Taxonomy of Diagrams in UML 2. 1 90
IBM Software Group | Rational software Composite Structure Diagrams New in UML 2 § A composite structure diagram can be used to represent the internal structure of a classifier, for instance a class 4 Allows to show details otherwise not visible on other diagrams, as illustrated in the following example: Same class diagram describes multiple implementations! § External structure of the classifier described using ports, “collection points” for the classifier’s provided and required interfaces § Internal structure shown using parts and connectors in the structure compartment (see example next slide) or in a structure diagram 91
IBM Software Group | Rational software Example of a Composite Structure Diagram Parts Ports 92
IBM Software Group | Rational software Components Revise d in UML 2 § Definition of a component: 4 Specifies a formal contract of the services that it provides to its clients (provided interfaces) and those that it requires from other components or services in the system (required interfaces) 4 Can be replaced at design time or run time by a component that offers equivalent functionality based on compatibility of its interfaces § Components can be used to: 4 Provide a high level, architectural view of the system 4 Represent the logical components that will be running on the physical systems Three views of the same component 93
IBM Software Group | Rational software Example of a Component Diagram The structure diagram of the Store component 94
IBM Software Group | Rational software Subsystems § A subsystem is a specialized version of a component, but it does not add anything to it 4 The decision to use a subsystem vs. a component is up to the methodology of the modeler 4 Subsystems are often equated to larger components 4 Component stereotyped <<subsystem>> 4 Note: There are other pre defined UML 2 component stereotypes (e. g. <<implement>>, <<specification>>, <<process>>, <<service>>) 95
IBM Software Group | Rational software Artifacts § An artifact is the specification of a physical piece of information that is used or produced by a software development process, or by deployment and operation of a system 4 Examples: source files, scripts, and binary executable files 4 Standard UML stereotypes: <<document>>, <<executable>>, <<file>>, <<library>>, <<script>>, <<source>> § The physical rendering of one or more model elements by an artifact is shown with a <<manifest>> dependency 4 May be further stereotyped (e. g. <<tool generated>>) § Artifacts may have composition associations to other artifacts that are nested within it 96
IBM Software Group | Rational software Deployment: Nodes and Communication Paths § A node is computational resource upon which artifacts may be deployed for execution 4 Examples: application server, client workstation, mobile device, embedded device § Nodes can be connected to represent a network topology by using communication paths 4 Specific network topologies can then be defined through links between node instances § Hierarchical nodes (i. e. , nodes within nodes) can be modeled using composition associations, or by defining an internal structure 97
IBM Software Group | Rational software Deploying Artifacts § A deployment is the allocation of an artifact or artifact instance to a deployment target § A deployment specification can be used to specify the execution parameters of a component artifact that is deployed on a node Two equivalent visual representations of the deployment of artifacts to a deployment target (including e dependency between the artifacts) 98
IBM Software Group | Rational software Deployment: Execution Environments § An Execution Environment is a node that offers an execution environment for specific types of components that are deployed on it in the form of executable artifacts 4 Examples: OS, workflow engine, database system, J 2 EE container § Execution Environment instances are assigned to node instances by using composite associations (the Execution Environment plays the role of the part) § Execution Environments can be nested (e. g. , a database Execution Environment may be nested in an operating system Execution Environment) 99
IBM Software Group | Rational software Deployment: Devices § A Device is a physical computational resource with processing capability upon which artifacts may be deployed for execution § Devices may be complex (i. e. , they may consist of other devices) A complete deployment diagrams with devices, execution environments and artifacts 100
IBM Software Group | Rational software State Machine Diagrams States Entry point Guard condition Transition Initial state “Do” activity Trigger and its “effect” Exit point Final state 101
IBM Software Group | Rational software Orthogonal State with Regions 102
IBM Software Group | Rational software State Machine Diagram with History 103
IBM Software Group | Rational software Activity Diagrams Control node (decision) Action Revise d in UML 2 Control node (fork and join) Activity parameter Input pin Output pin Object node (data store) 104
IBM Software Group | Rational software Activity Diagrams (cont. ) Activity diagram with partitions Activity diagram with Send / Receive Signal Actions 105
IBM Software Group | Rational software Use Case Diagrams Use Case Actor Optional system boundary Some authors recommend stereotyping system actors 106
- Slides: 106