100 likes | 238 Views
Basic Structural Modeling (continued) (Ch. 6 UG). Notes Comments with no semantic impact Text urls Link to documents Stereotypes A stereotype is an extension of the vocabulary of the UML, to allow creation of new building blocks. Tagged Values Add new properties {serverOnly}
E N D
Basic Structural Modeling (continued) (Ch. 6 UG) • Notes • Comments with no semantic impact • Text • urls • Link to documents • Stereotypes • A stereotype is an extension of the vocabulary of the UML, to allow creation of new building blocks. • Tagged Values • Add new properties {serverOnly} {processors = 3}
Constraints • A constraint is an extension of the semantics of a UML • adding or modifying rules • See fig 6-7 (p. 82 UG)
Common Modeling Techniques • Put a comment in a note and link the note to the corresponding (connection shows relationship) • Make a note visible or invisible • Link to long documents (external) • Modeling New Building Block • Use Standard Blocks and Stereotypes • Modeling New Properties for a UML element • Use stereotypes, and tagged values • Modeling New Semantics for a UML element • Use constraints
Discovering Object Interaction • Use case realization • Capture functionality • Scenario is an instance of a use case • “Scenarios speak the language of the end user and the domain expert, and therefor provide a means for them to state them to state their expectations about the desired behavior of a system to its developers.” • “Well structured interactions are like well-structured algorithms—efficient, simple adaptable, and understandable.” (p. 205 UG)
Sequence diagrams • Static aspects are modeled by class diagrams • Dynamic aspects by interactions • Messages • Object creation • Object destruction • Interactions are used to model the flow of control within an operation, a class, a component, a use case, or the system as a whole
Sequence Diagrams and Boundary Classes • Boundary classes show interaction with other systems (actors) • Not how the interface will be implemented • Collaboration diagrams • Alternate way to show a scenario • Organization of participants • Sequence diagrams ==> timing • Collaboration diagrams ==> big picture (design phase) • Show linking path • Show procedural sequence
Common Modeling Techniques • Modeling flow of control by time ordering • Set the context for the interaction • Identify participating objects/roles • Set the lifeline for each object • Start the message that initiates this interaction from the top • Adorn the lifeline of each object with its focus of control • Adorn timing marks with time/space constraints
Common Modeling Techniques • Modeling flow of control by organization • Same as sequence diagrams in first three steps • For an object whose state will be changed during this interaction create a duplicated object with new state and connected it with a message stereotyped as <<become>> or <<copy>> • Lay out association links • Lay out other links • Attach each message to the appropriate links with (nested) sequence numbers. • Attach pre/post-conditions
State Machines and Statecharts • State machine • A behavior that specifies the sequence of states an object goes through during its lifetime in response to evens, together with its responses to those events. • State • A condition or situation during the life of an object during which it satisfies some conditions, perform some activities, or waits for some events. • Fig 21-1 (p. 289 UG)
State diagrams • Events • An occurrence of a stimulus that cab trigger a state transition • Transition • A relationship between two states indicating that an object in the first state will perform certain actions and enter the second state when a specified event occurs and specified condition occurs. • Parts: • Source state • Target state • Event trigger • Guard condition • Action • Fig 21-3 (p. 294 UG)