CEN 5011 Advanced Software Engineering Fall 2004 Instructor

  • Slides: 53
Download presentation
CEN 5011 Advanced Software Engineering Fall 2004 Instructor: Masoud Sadjadi http: //www. cs. fiu.

CEN 5011 Advanced Software Engineering Fall 2004 Instructor: Masoud Sadjadi http: //www. cs. fiu. edu/~sadjadi/Classes/CEN-5011/ CEN 5011 Second Lecture September 8, 2004

Acknowledgements Overview: Modeling Dr. Betty Cheng Dr. Peter Clarke Dr. Bernd Bruegge Dr. Allen

Acknowledgements Overview: Modeling Dr. Betty Cheng Dr. Peter Clarke Dr. Bernd Bruegge Dr. Allen Dutoit UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 2

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Modeling UML Use Case Diagrams Class Diagrams Sequence Diagrams Statechart Diagrams Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 3

What is Modeling? Overview: Modeling consists of building an abstraction of a reality. Abstractions

What is Modeling? Overview: Modeling consists of building an abstraction of a reality. Abstractions are simplifications because: UML Use Case Diags. Class Diagrams Seq. Diagrams – They ignore irrelevant details. – They only represent the relevant details. Statechart Diags. Activity Diagrams Summary What is relevant or irrelevant depends on the purpose of the model. CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 4

Example of Modeling Overview: Modeling Street Map UML Use Case Diags. Class Diagrams Seq.

Example of Modeling Overview: Modeling Street Map UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 5

Why Model Software? Overview: Modeling Software is getting increasingly more complex – Windows XP

Why Model Software? Overview: Modeling Software is getting increasingly more complex – Windows XP > 40 million lines of code. – A single programmer cannot manage this amount of code in its entirety. UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Code is not easily understandable by developers who did not write it. We need simpler representations for complex systems Summary – Modeling is a mean for dealing with complexity. CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 6

Systems, Models, and Views Overview: Modeling – An abstraction describing a subset of a

Systems, Models, and Views Overview: Modeling – An abstraction describing a subset of a system. UML Use Case Diags. Class Diagrams View – Depiction of selected aspects of a model. Seq. Diagrams Statechart Diags. Model Notation – A set of graphical or textual rules for depicting views. – Views and models of a single system may overlap each other. Activity Diagrams Summary Examples: – System: Aircraft – Models: Flight simulator, scale model – Views: All blueprints, electrical wiring, fuel system CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 7

Concepts and Phenomena Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart

Concepts and Phenomena Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Phenomenon – An object in the world of a domain as you perceive it – Example: The lecture you are attending – Example: My black watch Concept – Describes the properties of phenomena that are common. – Example: Lectures on software engineering – Example: Black watches Concept is a 3 -tuple: – Name (To distinguish it from other concepts) – Purpose (Properties that determine if a phenomenon is a member of a concept) – Members (The set of phenomena which are part of the concept) CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 8

Concepts and Phenomena Overview: Modeling – Classification of phenomena into concepts. UML Use Case

Concepts and Phenomena Overview: Modeling – Classification of phenomena into concepts. UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Abstraction Modeling – Development of abstractions to answer specific questions about a set of phenomena while ignoring irrelevant details. Summary Name Purpose Clock A device that measures time. CEN 5011: Advanced Software Engineering Members Second Lecture on Sept. 8, 2004 9

Concepts in Software Overview: Modeling – An abstraction in the context of programming languages.

Concepts in Software Overview: Modeling – An abstraction in the context of programming languages. – Name: int, Purpose: integral number, Members: 0, 1, 1, 2, -2, . . . UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Type: Instance: – Member of a specific type. – The type of a variable represents all possible instances the variable can take. Summary The following relationships are similar: – type – concept instance phenomenon CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 10

Abstract Data Types and Classes Overview: Modeling Abstract data type – Special type whose

Abstract Data Types and Classes Overview: Modeling Abstract data type – Special type whose implementation is hidden from the rest of the system. UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Class – An abstraction in the context of object-oriented languages. – Like an abstract data type, a class encapsulates both state (variables) and behavior (methods). – Unlike abstract data types, classes can be defined in terms of other classes using inheritance. CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 11

Application and Solution Domain Overview: Modeling Application Domain – The environment in which the

Application and Solution Domain Overview: Modeling Application Domain – The environment in which the system is operating – How to model? UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Requirement Elicitation Requirements Analysis Activity Diagrams Summary Solution Domain – The available technologies to build the system – How to model? System Design Object Design CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 12

Object-Oriented Modeling Overview: Modeling – The environment in which the system is operating. UML

Object-Oriented Modeling Overview: Modeling – The environment in which the system is operating. UML Use Case Diags. Class Diagrams Seq. Diagrams Application Domain Solution Domain – The available technologies to build the system. Statechart Diags. Activity Diagrams Summary Application Domain Solution Domain Application Domain Model System Model Summary. Display Map. Display Traffic. Control Aircraft Traffic. Controller Flight. Plan Airport CEN 5011: Advanced Software Engineering Flight. Plan. Database Traffic. Control Second Lecture on Sept. 8, 2004 13

What should be done first? Overview: Modeling Coding or Modeling? – It all depends….

What should be done first? Overview: Modeling Coding or Modeling? – It all depends…. UML Use Case Diags. Class Diagrams Seq. Diagrams Forward Engineering: – Creation of code from a model. – Greenfield projects. Statechart Diags. Activity Diagrams Summary Reverse Engineering: – Creation of a model from code. – Interface or reengineering projects. Roundtrip Engineering: – Move constantly between forward and reverse engineering. – Useful when requirements, technology, and schedule are changing frequently. CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 14

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Modeling UML Use Case Diagrams Class Diagrams Sequence Diagrams Statechart Diagrams Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 15

Unified Modeling Language (UML) Overview: Modeling The Unified Modeling Language (UML) – UML is

Unified Modeling Language (UML) Overview: Modeling The Unified Modeling Language (UML) – UML is a standard language for writing software blueprints [Booch 99]. – An emerging standard for modeling object-oriented software. UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Objectives – The UML maybe used to visualize, specify, construct, and document the artifacts of a softwareintensive system [Booch 99]. Summary UML is a notation unifying – Object Modeling Technique (OMT) [Rumbaugh 91] – Object-Oriented Software Engineering (OOSE) [Jacobson 92] – Booch [Booch 94] CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 16

Types of Diagrams Overview: Modeling 1. Structural – Focus on static aspects of system.

Types of Diagrams Overview: Modeling 1. Structural – Focus on static aspects of system. UML Use Case Diags. Class Diagrams Seq. Diagrams 2. Behavioral – Focus on dynamic aspects of system (changing parts). Statechart Diags. Activity Diagrams Summary Note: – You can model 80% of most systems by using about 20 % UML. – In this course, we focus on those 20%. CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 17

Structural Diagrams Overview: Modeling – Describe the static structure of the system using objects,

Structural Diagrams Overview: Modeling – Describe the static structure of the system using objects, attributes, and associations. – A set of classes and their relationships. An interface is a collection of operations that specify a service of a class. UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Object Diagram – A set of objects and their relationships. Activity Diagrams Summary Class Diagram Component Diagram – A set of components and their relationships. – Component: Physical realization of a logical grouping of elements (e. g. , classes, interfaces). Deployment Diagram – A set of nodes and their relationships. – Exists at run time; Represents computational resources. – Node typically encloses one or more components. CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 18

Behavioral Diagrams Overview: Modeling – Describe the functional behavior of the system as seen

Behavioral Diagrams Overview: Modeling – Describe the functional behavior of the system as seen by the user. – User goals (high-level services of system). – Perspective from external entities (actors). UML Use Case Diags. Class Diagrams Seq. Diagrams Use Case Diagram Statechart Diags. Interaction Diagram – Describe the dynamic behavior between actors and the system and between objects of the system. Activity Diagrams Summary Sequence diagrams focus on time ordering of messages. Collaboration diagrams focus on structural organization of objects that send/receive messages. Statechart Diagram – Model the changing state of individual objects (essentially a finite state automaton). Activity Diagram – Model the workflow (essentially a flowchart) of a system. – Focus on flow of control from one activity to another. CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 19

Development Process Overview: Modeling – Use Case Diagram UML Use Case Diags. Statechart Diags.

Development Process Overview: Modeling – Use Case Diagram UML Use Case Diags. Statechart Diags. Identify major objects and relationships – Class diagram (object diagram) Class Diagrams Seq. Diagrams High-Level capture of requirements Create scenarios of usage – Interaction Diagrams Activity Diagrams Summary Sequence Diagram Collaboration Diagram Generalize scenarios to describe behavior – State Diagram – Activity Diagram Refine to add implementation details – Implementation Diagrams Component Diagram Deployment Diagram CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 20

UML Core Conventions Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Rectangles

UML Core Conventions Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Rectangles are classes or instances Ovals are functions or use cases Instances are denoted with an underlined names – my. Watch: Simple. Watch – Joe: Firefighter Statechart Diags. Activity Diagrams Summary Types are denoted with non underlined names – Simple. Watch – Firefighter Diagrams are graphs – Nodes are entities – Arcs are relationships between entities CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 21

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Modeling UML Use Case Diagrams Class Diagrams Sequence Diagrams Statechart Diagrams Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 22

Use Case Diagrams Overview: Modeling – represent a sequence of interaction for a type

Use Case Diagrams Overview: Modeling – represent a sequence of interaction for a type of functionality used during requirements elicitation to represent external behavior. – A use case model is the set of all use cases that is a complete description of the functionality of the system and its environment. UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Use cases Actors – represent roles, that is, a type of user of the system. Passenger CEN 5011: Advanced Software Engineering Purchase. Ticket Second Lecture on Sept. 8, 2004 23

Actor Overview: Modeling UML – A user, an external system, or a physical environment

Actor Overview: Modeling UML – A user, an external system, or a physical environment Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary An actor models an external entity which communicates with the system. An actor has a unique name and an optional description. – Passenger: A person in the train. – GPS satellite: Provides the system with GPS coordinates. Passenger CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 24

Use Case Overview: Modeling A use case represents a class of functionality provided by

Use Case Overview: Modeling A use case represents a class of functionality provided by the system as an event flow. A use case consists of: UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary – – – Unique name Participating actors Entry conditions Flow of events Exit conditions Special requirements Purchase. Ticket CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 25

Use Case Diagram: Example Overview: Modeling UML Use Case Diags. Class Diagrams – Passenger

Use Case Diagram: Example Overview: Modeling UML Use Case Diags. Class Diagrams – Passenger standing in front of ticket distributor. – Passenger has sufficient money to purchase ticket. Seq. Diagrams Statechart Diags. Activity Diagrams Name: Purchase ticket Participating actor: Passenger Entry condition: Exit condition: – Passenger has ticket. Summary Event flow: 1. Passenger selects the number of zones to be traveled. 2. Distributor displays the amount due. 3. Passenger inserts money, of at least the amount due. 4. Distributor returns change. 5. Distributor issues ticket. CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 26

The <<extends>> Relationship Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart

The <<extends>> Relationship Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Exceptional or seldom cases – The exceptional event flows are factored out of the main event flow for clarity. – It can extend more than one use case. – The direction is to the extended use case. Activity Diagrams Summary Passenger Purchase. Ticket <<extends>> Out. Of. Order <<extends>> Time. Out Cancel CEN 5011: Advanced Software Engineering No. Change Second Lecture on Sept. 8, 2004 27

The <<includes>> Relationship Overview: Modeling UML Use Case Diags. Behavior that is factored out

The <<includes>> Relationship Overview: Modeling UML Use Case Diags. Behavior that is factored out of the use case – For reuse, not because it is an exception. – The direction is to the using use case. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Passenger Summary Purchase. Multi. Card Purchase. Single. Ticket <<includes>> <<extends>> Collect. Money No. Change CEN 5011: Advanced Software Engineering <<extends>> Cancel Second Lecture on Sept. 8, 2004 28

Summary of Use Case Diagrams Overview: Modeling Use case diagrams represent external behavior. Use

Summary of Use Case Diagrams Overview: Modeling Use case diagrams represent external behavior. Use case diagrams are useful as an index into the use cases. Use case descriptions provide meat of model, not the use case diagrams. All use cases need to be described for the model to be useful. UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 29

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Modeling UML Use Case Diagrams Class Diagrams Sequence Diagrams Statechart Diagrams Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 30

Class Diagrams Overview: Modeling Class diagrams represent the structure of the system. Used UML

Class Diagrams Overview: Modeling Class diagrams represent the structure of the system. Used UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary – during requirements analysis to model problem domain concepts. – during system design to model subsystems and interfaces. – during object design to model classes. CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 31

Classes Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Classes Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Class – A class represent a concept. – A class encapsulates state (attributes) and behavior (operations). – Each attribute has a type. – Each operation has a signature. – The class name is the only mandatory information. Name Tarif. Schedule zone 2 price get. Zones() get. Price() CEN 5011: Advanced Software Engineering Attributes Operations Second Lecture on Sept. 8, 2004 32

Instances Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Instance

Instances Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Instance – An instance represents a phenomenon. – The name of an instance is underlined and can contain the class of the instance. – The attributes are represented with their values. Activity Diagrams Summary tarif_1974: Tarif. Schedule zone 2 price = { {‘ 1’, . 20}, {‘ 2’, . 40}, {‘ 3’, . 60}} CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 33

Actors, Classes, and Instances Overview: Modeling UML Use Case Diags. Class Diagrams – An

Actors, Classes, and Instances Overview: Modeling UML Use Case Diags. Class Diagrams – An entity outside the system to be modeled. – Interacts with the system (“Passenger”). Seq. Diagrams Statechart Diags. Activity Diagrams What is the difference between an actor, a class, and an instance? Actor: Summary Class: – An abstraction modeling an entity in the problem domain, must be modeled inside the system (“User”). Object: – A specific instance of a class (“Joe, the passenger who is purchasing a ticket from the ticket distributor”). CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 34

Associations Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Associations Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Associations denote relationships between classes. – Associations are uni- or bi-directional (no consensus). – The multiplicity of an association end denotes how many objects the source object can legitimately reference. – One-to-one, one-to-many, many-to-one, and manyto-many associations. Tarif. Schedule Enumeration get. Zones() Price get. Price(Zone) CEN 5011: Advanced Software Engineering Trip. Leg * * Price Zone Second Lecture on Sept. 8, 2004 35

Aggregation Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Aggregation Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Aggregation – A special case of association denoting a consists of hierarchy or is-part-of association. – The aggregate is the parent class. – The components are the children class. – A solid diamond denotes composition, a strong form of aggregation where components cannot exist without the aggregate. Exhaust system 1 Ticket. Machine 0. . 2 Muffler Tailpipe diameter CEN 5011: Advanced Software Engineering 3 Zone. Button Second Lecture on Sept. 8, 2004 36

Inheritance Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Inheritance Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Inheritance and Generalization The is-a association. – The children classes inherit the attributes and operations of the parent class. – Inheritance simplifies the model by eliminating redundancy. – Summary Button Cancel. Button CEN 5011: Advanced Software Engineering Zone. Button Second Lecture on Sept. 8, 2004 37

Packages Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Packages Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Package – A package is a UML mechanism for organizing elements into groups (usually not an application domain concept) – Packages are the basic grouping construct with which you may organize UML models to increase their readability. – A complex system can be decomposed into subsystems, where each subsystem is modeled as a package. Dispatcher. Interface Notification CEN 5011: Advanced Software Engineering Incident. Management Second Lecture on Sept. 8, 2004 38

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Modeling UML Use Case Diagrams Class Diagrams Sequence Diagrams Statechart Diagrams Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 39

Sequence Diagrams Overview: Modeling – to refine use cases. – to find additional objects.

Sequence Diagrams Overview: Modeling – to refine use cases. – to find additional objects. UML Use Case Diags. Class Diagrams Requirements analysis: System design : Passenger – to refine subsystem interfaces. Seq. Diagrams Statechart Diags. Ticket. Machine select. Zone() Activity Diagrams Summary Classes are represented by columns. Messages are represented by arrows. Activations are represented by narrow rectangles. Lifelines are represented by dashed lines. CEN 5011: Advanced Software Engineering insert. Coins() pickup. Change() pick. Up. Ticket() Second Lecture on Sept. 8, 2004 40

Nested messages Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags.

Nested messages Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary The source of an arrow indicates the activation which sent the message An activation is as long as all nested activations Horizontal dashed arrows indicate data flow Vertical dashed lines indicate lifelines Zone. Button Tarif. Schedule Passenger select. Zone() lookup. Price(selection) Dataflow Display price display. Price(price) …to be continued. . . CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 41

Iteration and Condition Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Iteration

Iteration and Condition Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Iteration is denoted by a * preceding the message name. Condition is denoted by boolean expression in [ ] before the message name. Statechart Diags. Activity Diagrams …continued from previous slide. . . Summary Change. Processor. Coin. Identifier Passenger *insert. Change(coin) lookup. Coin(coin) Iteration Condition Display Coin. Drop price display. Price(owed. Amount) [owed. Amount<0] return. Change(-owed. Amount) …to be continued. . . CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 42

Creation and Destruction Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart

Creation and Destruction Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Creation is denoted by a message arrow pointing to the object. Destruction is denoted by an X mark at the end of the destruction activation. – In garbage collection environments, destruction can be used to denote the end of the useful life of an object. …continued from previous slide. . . Passenger Change. Processor Creation create. Ticket(selection) Ticket print() free() CEN 5011: Advanced Software Engineering Destruction Second Lecture on Sept. 8, 2004 43

Summary of Sequence Diagram Overview: Modeling UML sequence diagram represent behavior in terms of

Summary of Sequence Diagram Overview: Modeling UML sequence diagram represent behavior in terms of interactions. Useful to find missing objects. Time consuming to build but worth the investment. Complement the class diagrams (which represent structure). UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 44

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Modeling UML Use Case Diagrams Class Diagrams Sequence Diagrams Statechart Diagrams Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 45

State Chart Diagrams Overview: Modeling • Represent behavior as states and transitions UML Use

State Chart Diagrams Overview: Modeling • Represent behavior as states and transitions UML Use Case Diags. Event Initial state State Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Transition Final state CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 46

Activity Diagrams Overview: Modeling UML – a special case of a state chart diagram

Activity Diagrams Overview: Modeling UML – a special case of a state chart diagram in which states are activities (“functions”). Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary An activity diagram shows flow control within a system Two types of states: – Action state: Cannot be decomposed any further. Happens “instantaneously” with respect to the level of abstraction used in the model. – Activity state: Can be decomposed further. The activity is modeled by another activity diagram. CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 47

Statechart vs. Activity Diagrams Overview: Modeling Statechart Diagram – for Incident similar to Mealy

Statechart vs. Activity Diagrams Overview: Modeling Statechart Diagram – for Incident similar to Mealy Automaton. – State: Attribute or Collection of Attributes of object of type Incident. UML Use Case Diags. Class Diagrams Event causes State transition Seq. Diagrams Statechart Diags. Activity Diagrams Active Summary Incident. Handled Inactive Incident. Documented Closed Incident. Archived Activity Diagram – for Incident similar to Moore Automation – State: Operation or Collection of Operations. Completion of activity causes state transition CEN 5011: Advanced Software Engineering Triggerless Transition Second Lecture on Sept. 8, 2004 48

Modeling Decisions Overview: Modeling decisions using activity diagrams UML Use Case Diags. Class Diagrams

Modeling Decisions Overview: Modeling decisions using activity diagrams UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 49

Modeling Concurrency Overview: Modeling UML Use Case Diags. Modeling concurrency using activity diagrams –

Modeling Concurrency Overview: Modeling UML Use Case Diags. Modeling concurrency using activity diagrams – Synchronization of multiple activities – Splitting the flow of control into multiple threads Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Splitting CEN 5011: Advanced Software Engineering Synchronization Second Lecture on Sept. 8, 2004 50

Activity Diagrams: Swimlanes Overview: Modeling UML Use Case Diags. Actions may be grouped into

Activity Diagrams: Swimlanes Overview: Modeling UML Use Case Diags. Actions may be grouped into swimlanes to denote the object or subsystem that implements the actions. Class Diagrams Seq. Diagrams Statechart Diags. Allocate Resources Activity Diagrams Dispatcher Summary Open Incident Coordinate Resources Archive Incident Field. Officer Document Incident CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 51

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity

Agenda Overview: Modeling UML Use Case Diags. Class Diagrams Seq. Diagrams Statechart Diags. Activity Diagrams Summary Modeling UML Use Case Diagrams Class Diagrams Sequence Diagrams Statechart Diagrams Activity Diagrams Summary CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 52

Summary of UML Overview: Modeling UML Use Case Diags. Class Diagrams UML provides a

Summary of UML Overview: Modeling UML Use Case Diags. Class Diagrams UML provides a wide variety of notations for representing many aspects of software development. – A powerful, but complex language. – It can be misused to generate unreadable models. – It can be misunderstood when using too many exotic features. Seq. Diagrams Statechart Diags. Activity Diagrams Summary For now we concentrate on a few notations: – Functional model: Use case diagrams – Object model: Class diagrams – Dynamic model: Sequence, statechart and activity diagrams CEN 5011: Advanced Software Engineering Second Lecture on Sept. 8, 2004 53