Presentation is loading. Please wait.

Presentation is loading. Please wait.

Collaboration and Class Diagrams March 30, 2004. Agenda Training Plan Overview Review Sequence Diagrams Diagram Elements Use in the Models Statechart.

Similar presentations


Presentation on theme: "Collaboration and Class Diagrams March 30, 2004. Agenda Training Plan Overview Review Sequence Diagrams Diagram Elements Use in the Models Statechart."— Presentation transcript:

1 Collaboration and Class Diagrams March 30, 2004

2 Agenda Training Plan Overview Review Sequence Diagrams Diagram Elements Use in the Models Statechart Diagrams State Machines States Transitions Collaboration Diagrams Class Diagrams Exercise Next Steps

3 Training Plan Overview Introduction Using Rational Administrator Using ClearCase Using ClearQuest Using Rational Rose XDE Identifying & Creating Use-Cases – Part 1 Identifying & Creating Use-Cases – Part 2 Detailing Requirements with RequisitePro Actors and Use-Case Diagrams Sequence and Statechart Diagrams Collaboration and Class Diagrams Integration and Development with the.NET Framework

4 Review - Sequence Diagrams Uses Show object interaction in a time-based sequence Establish the roles of objects Provide essential information to determine class responsibilities and interfaces Two dimensions Vertical representing time Horizontal representing different objects

5 Review – SD – Elements Objects/Classes Lifelines Focus of Control Text (Scripts) Note Note Anchor Class Object Message Message To Self Return Message Destruction Marker Procedure Call Asynchronous Message

6 Review – SD – Lifeline UML Section Is Specification Collections Stereotypes Documentation

7 Review – SD – Messages UML Section Message Name Simple English Alias Guard Condition Is Specification Collections Stereotypes Message Signature Documentation

8 Review – SD – Messages Collections Arguments Name Type Value Stereotype

9 Review – SD – Messages Detail Tab Synchronization Simple –The message has a single thread of control Synchronous –The operation proceeds only when the client sends a message to the supplier and the supplier accepts the message Balking –The client passes a message only if the supplier is immediately ready to accept the message; the client abandons the message if the supplier is not ready Timeout –The client abandons a message if the supplier cannot handle the message within a specified amount of time.

10 Review – SD – Messages Detail Tab Synchronization Procedure Call –The operation only proceeds on return and may return results Asynchronous –The client sends a message to the supplier for processing and continues to execute its code without waiting for or relying on the supplier's receipt of the message NotASyncType –Unspecified Return –Returns control and may return results Frequency Aperiodic Periodic

11 Review – SD – Control Flow Control Flow Centralized control of a flow of events or part of the flow of events means that a few objects steer the flow by sending messages to, and receiving messages from other objects Use –If the order in which the sub-event phases will be performed is likely to change –To insert new sub-event phases –To keep parts of the functionality reusable as separate pieces To recognize look for fork- shaped structure

12 Review – SD – Control Flow Decentralized control arises when the participating objects communicate directly with one another, not through one or more controlling objects Use –If sub-event phases are tightly coupled –If forming a part-of or consists-of hierarchy –To form a conceptual inheritance hierarchy –To represent a fixed chronological progression –To encapsulate and thereby make abstractions of functionality To recognize look for stairway-shaped structure

13 Review - Sequence Diagrams Sub-Sequence Use to reduce complexity Recognition Occurs repeatedly in different places Is expected to be performed repeatedly in future iterations Is complex but easily encapsulated Is determined to be encapsulated within a replaceable sequence

14 Review - Sequence Diagrams Transactions Define a set of operation invocations which are atomic; they are either all performed, or none of them are performed Beginning / End Textual Explicit Message

15 Review - States & Transitions State A condition of an object in which it performs some activity or waits for an event. Transition A relationship between two states which is triggered by some event, which performs certain actions or evaluations, and which results in a specific end-state State Machine Consists of states, linked by transitions. Used To Model Dynamic Behavior Event-driven aspects of the system's behavior State-dependent behavior

16 Review - Statechart Diagrams

17 Review - State Properties Name Entry / Exit Actions Internal Transitions Transitions that are handled without causing a change in state Substates The nested structure of a state, involving disjoint (sequentially active) or concurrent (concurrently active) substates Properties Name Trigger Guard Condition Action Pseudo-states Name Initial – Final Transition –No Trigger Deferred States A list of events that are not handled in that state but are postponed and queued for handling by the object in another state

18 Review - State Transition Properties Event Short Description of why an object in the “Source State” will perform certain actions and enter the “Target State” Stereotype Event Trigger The event that makes the transition eligible to fire Guard Condition A condition which must be satisfied before the transition can fire Action

19 Review – Statechart Diagrams

20 Model Sequence Set Context Define Initial / Final States Pre/Post Conditions Define Events Define Intermediate States Connect with transitions Define Entry / Actions Define Substates Expand / Consolidate Validate Object/Class Use Analyze & Re- analyze

21 Review – Statechart Diagrams Nested State Machine One Initial and One Final State Composite State Unlimited Depth Control Based on Transition Type Entry/Exit Action –To/From Composite –To/From Nested State –Via Composite History State Allows the return to a previous sub-state within a nested state

22 Review – Statechart Diagrams Abstract State Machines Need to have more detail added before it can be used for practical purposes Utilize Inheritance Root Class

23 Review – Statechart Diagrams Chained States Transition Extension Separates the internal specification of the containing state from its external environment Encapsulation No internal structure Any number of input transitions May have an outgoing transition with no trigger event Automatically fires when an input transition activates the state

24 Collaboration Diagrams Used to show how objects interact to perform the behavior of a particular use case Used to define and clarify the roles of the objects that perform a particular flow of events of a use case Are the primary source of information used to determining class responsibilities and interfaces Better suited to depicting simpler interactions of smaller numbers of objects.

25 Collaboration Diagrams - Elements Elements Objects Actor instances Links Messages Function Describes what takes place in terms of how the objects communicate by sending messages to one another

26 Collaboration Diagrams - Links A relationship among objects across which messages can be sent Show as a solid line Can be an instance of an association, or it can be anonymous, meaning that its association is unspecified. An object interacts with, or navigates to, other objects through its links to these objects. Message flows are attached to links

27 Collaboration Diagrams - Messages Communication between objects that conveys information with the expectation that activity will ensue Shown as a labeled arrow placed near a link May contain parameters May contain sequence numbers Two states Unassigned Assigned

28 Class Diagrams Static structure of the model Objects / Classes Internal structure –Attributes –Operations Relationships to other classes Do not show temporal information

29 Class Diagrams - Types A single class, its attributes, operations, and relationships with other classes Classes that participate in a specific use-case realization Functionally related or coherent classes Important aggregation and generalization hierarchies Important structures of entity classes Class structures Relationships –Association –Aggregation –Generalization Design subsystems, classes, interfaces, and their relationships Packages Classes that belong to the same package Dependencies Layering

30 Class Diagrams - Types

31 Class Diagrams - Elements Object / Class Stereotypes Business Actor Business Worker Business Entity Business Use-Case Actor Entity Use-Case Component Capsule Associations Stereotypes

32 Class Diagrams – Objects / Classes Properties Window UML Section Name Stereotype Multiplicity Persistence Abstract Is Leaf Is Root Is Specification Visibility

33 Objects / Classes – Stereotype Stereotype Objects –Boundary –Control –Entity Classes –Implementation –MetaClass –Powertype –Process –Thread –Type –Utility

34 Objects / Classes - Stereotypes Boundary An object which interfaces with the user Control An object that controls a use-case Entity An object that participates in a use-case

35 Objects / Classes - Stereotypes ImplementationClass Indicates that the class identifies the physical implementation MetaClass A class whose instances are other classes that conform to the metaclass Powertype Indicates that the classifier is a parent and can support subclasses

36 Objects / Classes - Stereotypes Process Indicates that the classifier provides the implementation for an active object in a heavyweight process Thread Provides the implementation of an active object in a lightweight process Type Identifies a class representing a base data type Utility Indicates that the classifier has no instances but whose attributes and operations have class scope

37 Objects / Classes – Visibility Visibility Public –The element is visible outside of the enclosing package and you can import it to other portions of your model. Operations are accessible to all clients. Protected –The element is accessible only to nested classes, friends, or to the class itself. Private –The element is accessible only to nested classes, friends, or to the class itself. Implementation –The element is visible only in the package in which it is defined. An operation is part of the implementation of the class.

38 Class Diagrams – Objects / Classes Properties Window Classic Rose Section Type Concurrency Space Language

39 Objects / Classes - Concurrency Concurrency Sequential Guarded Active Synchronous

40 Objects / Classes - Attributes Attributes Tab Show Inherited Show Realized Attributes

41 Objects / Classes - Attributes Stereotype Name Content Visibility TypeExpression DefaultValueExpression Aggregation Alias

42 Class Diagrams – Attributes Changeability Collections IsByValueIfComposite IsDerived IsSpecification Ordering OwnerScope Persistence QUID TargetScope

43 Objects / Classes - Operations Operations Tab Show Inherited Show Realized Operations

44 Objects / Classes - Operations Stereotype Name Context Stereotype Visibility Collections Alias Concurrency Exceptions IsAbstract

45 Objects / Classes - Operations IsQuery IsRoot IsSpecification OwnerScope PostConditions PostIntDgm PreConditions PreIntDgm Protocol Qualification Quid

46 Objects / Classes - Operations SemIntDgm Semantics Size Time Virtual

47 Objects / Classes - Arguments Collections Parameters Tab

48 Objects / Classes - Parameters Stereotype Name Kind TypeExpression DefaultValueExpression Alias Collections IsSpecification Quid

49 Objects / Classes - Associations

50 Stereotype Name Context Kind Collections Alias Characteristics IsDerived IsSpecification Language Persistence Quid

51 Objects / Classes - Associations End?Changeability End?Friend End?InitialValueExpression End?Multiplicity End?Name End?Ordering End?Quid End?Stereotype End?SupplierName End?TargetScope End?TypeExpression End?Visibillity

52 Objects / Classes - Associations Stereotypes Abstraction A type of dependency relationship that relates two model elements (or sets of model elements) that represent the same concept at different levels of abstraction or from different viewpoints Aggregation A relationship that indicates that one classifier is a part of or subordinate to another classifier Binding A type of dependency relationship that assigns values to template parameters in order to generate a new model element (a class or collaboration) from the template (a template class or template collaboration) Composition A relationship that represents a "whole/part" relationship

53 Objects / Classes - Associations Stereotypes Dependency A dependency relationship indicates that a change to one model element (the supplier) may cause a change in the other model element (the consumer) Deploy A deploy relationship indicates the specific component instances that a single node instance deploys or uses Directed A directed association is an association relationship that is navigable in only one direction, indicating that the control flows from one classifier to another (for example, from an actor to a use case) Extend An extend relationship specifies that the behaviors defined in one use case (extension use case) can be inserted into another use case (base use case)

54 Objects / Classes - Associations Stereotypes Generalization A generalization relationship (sometimes called an is-a relationship) indicates that a specialized (child) model element is based on a general (parent) model element Include An include relationship specifies that a base use case uses the behavior defined in another use case (inclusion use case) Realization A realization is a relationship that exists between two model elements when one of them must realize, or implement, the behavior specified by the other Reside A reside is a relationship that indicates that a class or component resides in a component or artifact Usage A usage relationship is a type of dependency relationship in which one model element requires the presence of another model element (or set of model elements) for its full implementation or operation

55 Associations – Qualifiers Stereotype Name Visibility TypeExpression DefaultValueExpressi on Aggregation Alias Changeability Collections

56 Associations – Qualifiers IsByValueIfComposition IsDerived IsSpecification Ordering OwnerScope Persistence Quid TargetScope

57 Objects / Classes - Classifiers Stereotype Name IsAbstract IsLeaf IsSpecification Persistence Visibility Collections

58 Objects / Classes - Classifiers Alias Concurrency IsActive Language Multiplicity Quid Space Type

59 Objects / Classes - Component Stereotype Name Visibility ConsumerContext Alias Collections IsSpecification Quid

60 Objects / Classes - Relationships Stereotype Name To Collections Alias Friend IsSpecification Quid Virtual Visibility

61 Next Steps Homework Homework Model Explode Classes –Use property elements Add Class Diagrams –Use modeling elements Classes Ahead Integration and Development with the.NET Framework


Download ppt "Collaboration and Class Diagrams March 30, 2004. Agenda Training Plan Overview Review Sequence Diagrams Diagram Elements Use in the Models Statechart."

Similar presentations


Ads by Google