Software Engineering I Oct. 30, 2012 Notes Modeling interactions and behavior - Modeling system dynamics - Looking at two different types of interaction + Diagrams used to model detailed scenarios of system execution - UML Sequence Diagrams - UML Communication Diagrams + Diagrams used to model system behavior - UML State Diagrams - UML Activity Diagrams What are Interaction Diagrams? - Used to model dynamic aspects of a system - To see how it runs - Includes instances of classes or actors and messages shown as arrows + Messages are from actor to object or from object to object - Helps to understand the sequence of messages Sequence diagrams - messages exchanged by sets of objects and possibly actors for a given task - Objects are arranged from left to right - Actor initiates interaction on the left - Start at the top of the diagram - Time progresses downward - Lifeline - Vertical dashed lines relate the object to its progression of actions over time. - Connects object to activation box - Activation Box - small box attached to lifeline indicating the time during which computations are performed. Example Class Diagram +-------------------+ +-----------------------+ +------------+ | Course | 1 * | CourseSection | 1 * |Registration| +-------------------+-------+-----------------------+-------+------------+ | getPrerequisite() | | requestToRegister() | | * +-------------------+ |addToRegistrationList()| | +-----------------------+ | 1 +-----------------+ | Student | +-----------------+ |addToSchedule() | |hasPassedCourse()| +-----------------+ Example Sequence Diagram O -+- +----------------+ +----------+ | | :CourseSection | | :Student | / \ | -------------- | | -------- | +----------------+ +----------+ | requestToRegister | create +---------------+ | +-+ - - - - - - - - |> +-+ - - - - - |>| :Registration | | | | | | ------------- | | | | | | +---------------+ +-+ | | | | | |- - - - - - |>| | | | | | addToRegistrationList | | addToSchedule| | | | | |<| - - - - - - - - - - | | | | +-+ +-+ +--+ +-+ | | | | | | | |