Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)

Slides:



Advertisements
Similar presentations
SEQUENCE DIAGRAM. UML diagrams There are many ways of organizing the UML diagrams. Can be organized as the fallowing: 1. Structural diagrams: to show.
Advertisements

Chapter 4,Use Case and Statechart Diagrams
Slides by Bruegee and Dutoit, Modified by David A. Gaitros COP 3331 Object Oriented Analysis and Design Chapter 2: Object Oriented Modeling using UML Jean.
Chapter 2, Modeling with UML, Part 2
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Interaction Diagrams Software Engineering BIT8. Interaction Diagrams  A series of diagrams describing the dynamic behavior of an object-oriented system.
Requirements Engineering Processes
Systems Analysis and Design in a Changing World, Fourth Edition
Chapter 2, Modeling with UML
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 5, Analysis: Dynamic Modeling.
Bernd Bruegge & Allen Dutoit Object-Oriented Software Engineering: Conquering Complex and Changing Systems 1 UML First Pass: Class Diagrams Battery load()
Bernd Bruegge & Allen Dutoit Object-Oriented Software Engineering: Conquering Complex and Changing Systems 1 UML Sequence Diagrams  Used during system.
Unified Modeling Language (UML) Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Using UML, Patterns, and Java Object-Oriented Software Engineering Modeling with UML Chapter 2 Object-Oriented Software Engineering: Using UML, Patterns,
Unified Modeling Language (UML)
1 Modeling with UML CMPE 131 Fall Overview What is modeling? What is UML? Use case diagrams Class diagrams Sequence diagrams Activity diagrams.
Blaha and Rumbaugh Sections 7.2 and 8.2
Unified Modeling Language
Chapter 7: The Object-Oriented Approach to Requirements
SEQUENCE DIAGRAM Prepared by: T. Fatimah Alageel.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML.
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
COP 3331 Object-Oriented Analysis and Design 1 Modeling and UML  UML = Unified Modeling Language  Graphical Notation  Topics  Modeling  Basics of.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Introduction to Software Engineering ECSE-321 Unit 5 – Modeling with UML.
1 Behavioral diagrams (2) Lecture p5 T120B pavasario sem.
Modeling with UML Chapter 2 Object-Oriented Software Engineering: Using UML, Patterns, and Java, 2 nd Edition By B. Bruegge and A. Dutoit Prentice Hall,
Systems Analysis and Design in a Changing World, Fifth Edition
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 4, Requirements Elicitation.
UML Diagrams: Sequence Diagrams The Requirements Model, and The Dynamic Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 1 Object Modeling.
Chapter 2, Modeling with UML, Part 2
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
UML Review of diagram types. 2 Unified Modeling Language The Unified Modeling Language™ (UML) was developed jointly by Grady Booch, Ivar Jacobson, and.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
1 An Introduction to UML Interaction (Sequence and Communication) Diagrams Georgia State University CIS 3300 Spring, 2009.
Bernd Bruegge & Allen Dutoit Object-Oriented Software Engineering: Conquering Complex and Changing Systems 1 Software Engineering September 19, 2001 UML.
Introduction to UML 임현승 강원대학교 Revised from the slides by Bernd Bruegge and Allen H. Dutoit for the book “Object-Oriented Software Engineering: Using UML,
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Using UML, Patterns, and Java Object-Oriented Software Engineering More on UML Note: Slides are adapted by Linda Sherrell from the Software Engineering.
Systems Analysis and Design in a Changing World, Fourth Edition
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
UML Review of Use case diagrams. 2 Unified Modeling Language The Unified Modeling Language™ (UML) was developed jointly by Grady Booch, Ivar Jacobson,
UML Review Overview: modeling with UML  What is modeling?  What is UML?  Use case diagrams  Class diagrams  Sequence diagrams  Activity diagrams.
CEN 5011 Advanced Software Engineering
 The Sequence Diagram models the collaboration of objects based on a time sequence.  It shows how the objects interact with others in a particular scenario.
1 Kyung Hee University Interaction Diagrams Spring 2001.
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 14 Slide 1 Object-Oriented Design.
1 An Overview of UML. 2 The Unified Modeling Language UML is a graphical language used by software engineers to model software systems during development.
Chapter 2, Modeling with UML
UML Review.
Chapter 2, Modeling with UML, Part 2
Chapter 2, Modeling with UML
Chapter 2: Modeling with UML - 2
UML Diagrams: Class Diagrams The Static Analysis Model
CS410 – Software Engineering Lecture #17: UML I
Chapter 2, Modeling with UML
Chapter 2, Modeling with UML
Chapter 2, Modeling with UML
Presentation transcript:

Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2 Outline for this Week Last Lecture: Modeling Functions, Structure and Behavior Use case diagrams Class diagrams Sequence diagrams, State chart diagrams, Activity diagrams Today we review these concepts Review: Why UML? Review: Diagram notations Next Lecture: Deployment diagrams Stereotypes and Profiles UML 2 Meta model

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3 We use Models to describe Software Systems System model: Object model + functional model + dynamic model Object model: What is the structure of the system? UML Notation: Class diagrams Functional model: What are the functions of the system? UML Notation: Use case diagrams Dynamic model: How does the system react to external events? UML Notation: Sequence, State chart and Activity diagrams

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 4 Another view on UML Diagrams

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 5 Review of Use Case Diagrams: 3 Important Terms An actor represents a role, that is, a type of user of the system Student DoHomework Used during requirements elicitation and analysis to represent behavior visible from the outside of the system Use case model: The set of all use cases that completely describe the functionality of the system. A use case represents a class of functionality provided by the system

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 6 Actor An actor is a model for an external entity which interacts with the system: EndUser, Administrator External system (Another system) Physical environment (e.g. Weather) An actor has a unique name and an optional description Examples: Student: A studying person Teaching Assistant: Member of teaching staff who supports the instructor. Random Number generator Student Name Optional Description

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 7 Use Case A use case represents a class of functionality provided by the system Use cases can be described textually, with a focus on the event flow between actor and system The textual use case description consists of 6 parts: 1.Unique name 2.Participating actors 3.Entry conditions 4.Exit conditions 5.Flow of events 6.Special requirements. DoHomework

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 8 Use Case Model Use case diagrams represent the functionality of the system from user’s point of view Actor. Use Case System boundary Classifier

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 9 Uses Cases can be related Extend Relationship To represent seldom invoked use cases or exceptional functionality Include Relationship To represent functional behavior common to more than one use case.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 10 The > Relationship > relationships model exceptional or seldom invoked cases The exceptional event flows are factored out of the main event flow for clarity The direction of an > relationship is to the extended use case Use cases representing exceptional flows can extend more than one use case. Student DoHomework Party > Sleep > FetchLostSheet > DrinkCoffee >

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 11 The > Relationship > relationship represents common functionality needed in more than one use case > behavior is factored out for reuse, not because it is an exception The direction of a > relationship is to the using use case (unlike the direction of the > relationship). Student GiveLecture HoldExercise > AskQuestion > NoAnswer > SillyQuestion > WrongAnswer > DoHomework

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 12 Textual Use Case Description Example 1. Name: DoHomework 2. Participating actor: Student 3. Entry condition: Student received exercise sheet Student is in good health 4. Exit condition: Student delivered solution 5. Flow of events: 1. Student fetches the exercise sheet 2. Student reads through the assignments 3. Student processes the assignments and types the solution in his Computer. 4. Student prints out the solution 5. Student delivers the solution in the following exercise 6. Special requirements : None. Student DoHomework

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 13 Review of Class Diagrams Class Association End Name (Role) Multiplicity Class diagrams represent the structure of the system Aggregation Inheritance

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 14 Actor vs Class vs Object Actor An entity outside the system to be modeled, interacting with the system (“Passenger”) Class An abstraction modeling an entity in the application or solution domain The class is part of the system model (“User”, “Ticket distributor”, “Server”) Object A specific instance of a class (“Joe, the passenger who is purchasing a ticket from the ticket distributor”).

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 15 Many-to-many Associations StockExchange Company tickerSymbol Lists * * A stock exchange lists many companies. Each company is identified by a ticker symbol

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 16 From Problem Statement To Object Model Class Diagram: StockExchange Company tickerSymbol Lists ** Problem Statement: A stock exchange lists many companies. Each company is uniquely identified by a ticker symbol

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 17 From Problem Statement to Code Problem Statement: A stock exchange lists many companies Each company is identified by a ticker symbol Class Diagram: private Vector m_Company = new Vector(); public int m_tickerSymbol; private Vector m_StockExchange = new Vector(); public class StockExchange { }; public class Company { }; Java Code tickerSymbol Lists StockExchange Company * * Associations are mapped to attributes.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 18 Code Generation from UML to Java I public class Component{ } public class Leaf extends Component{ } public class Composite extends Component{ private Collection components; … }

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 19 Code Generation from UML to Java II public abstract class Target{ public … operation(); } public class Adapter extends Target { private AdaptedClass adaptedObject; public … operation(){ adaptedObject.specificOperation(); }

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 20 Where are we? Review functional modeling Use case diagram Review object modeling Class diagram Generating source code from class diagrams  Review dynamic modeling  Sequence diagram Statechart diagram

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 21 Execution Specification Sequence diagram: Basic Notation Sequence diagrams represent the behavior of a system as messages (“interactions”) between different objects. Lifeline Message

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 22 Lifeline and Execution Specification A lifeline represents an individual participant (or object) in the interaction A lifeline is shown using a symbol that consists of a rectangle forming its “head” followed by a vertical line (which may be dashed) that represents the lifetime of the participant An execution specification specifies a behavior or interaction within the lifeline An execution specification is represented as a thin rectangle on the lifeline.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 23 Messages Define a particular communication between lifelines of an interaction Examples of communication raising a signal invoking an operation creating or destroying an instance Specify (implicitly) sender and receiver are shown as a line from the sender to the receiver Form of line and arrowhead reflect message properties

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 24 Message Types Asynchronous Synchronous Call and Object creation Reply Lost Found

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 25 Sequence Diagrams Used during analysis To refine use case descriptions to find additional objects (“participating objects”) Used during system design to refine subsystem interfaces Instances are represented by rectangles. Actors by sticky figures Lifelines are represented by dashed lines Messages are represented by arrows Activations are represented by narrow rectangles. selectZone() pickupChange() pickUpTicket() insertCoins() TicketMachine Passenger Focus on Controlflow Messages -> Operations on participating Object zone2price selectZone() insertCoins() pickupChange() pickUpTicket() TicketMachine

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 26 Sequence Diagrams can also model the Flow of Data The source of an arrow indicates the activation which sent the message Horizontal dashed arrows indicate data flow, for example return results from a message Passenger selectZone() ZoneButtonTarifScheduleDisplay lookupPrice(selection) displayPrice(price) price Dataflow …continued on next slide...

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 27 Sequence Diagrams: Iteration & Condition Iteration is denoted by a * preceding the message name Condition is denoted by boolean expression in [ ] before the message name Passenger ChangeProcessor insertChange(coin) CoinIdentifierDisplayCoinDrop displayPrice(owedAmount) lookupCoin(coin) price [owedAmount<0] returnChange(-owedAmount) Iteration Condition …continued on next slide... …continued from previous slide... *

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 28 Creation and destruction 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. Passenger ChangeProcessor …continued from previous slide... Ticket createTicket(selection) free() Creation of Ticket Destruction of Ticket print()

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 29 Sequence Diagram Properties UML sequence diagram represent behavior in terms of interactions Useful to identify or find missing objects Time consuming to build, but worth the investment Complement the class diagrams (which represent structure).

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 30 UML Statechart diagram State Initial state Final state Transition Event Represents behavior of a single object with interesting dynamic behavior. button1&2Pressed button1Pressed button2Pressed button1Pressed button1&2Pressed Increment Minutes Increment Hours Blink Hours Blink Seconds Blink Minutes Increment Seconds Stop Blinking