Chapter 2, Modeling with UML

Slides:



Advertisements
Similar presentations
Notice: Surgery Sessions (Weeks 6-10)
Advertisements

Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Software analysis and design tools T120B pavasario sem.
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.
Chapter 3,Class Diagram.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Chapter 2, Modeling with UML
Bernd Bruegge & Allen Dutoit Object-Oriented Software Engineering: Conquering Complex and Changing Systems 1 UML First Pass: Class Diagrams Battery load()
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.
Bernd Bruegge & Allen Dutoit Object-Oriented Software Engineering: Conquering Complex and Changing Systems 1 Software Engineering September 5, 2001 Introduction.
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.
Unified Modeling Language
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Course information and deadline reminders
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.
COP 3331 OBJECT-ORIENTED ANALYSIS AND DESIGN Bob Myers Department of Computer Science Week 6 Lecture.
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,
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Chapter 2, Modeling with UML, Part 2
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
Unit 1 INTRODUCTION TO MODELING AND CLASS MODEL Ref : L7-UML.PDF.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
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,
Using UML, Patterns, and Java Object-Oriented Software Engineering More on UML Note: Slides are adapted by Linda Sherrell from the Software Engineering.
COP 3331 OBJECT-ORIENTED ANALYSIS AND DESIGN Bob Myers Department of Computer Science.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
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
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.
Chapter 2, Modeling with UML
UML Review.
Modeling with UML Chapter 2
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
The Movement To Objects
UML Class Diagrams.
Introduction to UML.
Before we start Project Group A note about class project ArgoUML
Object-Oriented Analysis and Design
Review for Midterm, Fall 2009
CS410 – Software Engineering Lecture #17: UML I
Introduction to Unified Modeling Language (UML)
Chapter 2, Modeling with UML
Chapter 2, Modeling with UML
Chapter 2, Modeling with UML
Domain Class Diagram Chapter 4 Part 2 pp
Chapter 2, Modeling with UML
Chapter 2, Modeling with UML
Chapter 2, Modeling with UML
Recap : UML artefacts Black Box Requirements Functional Specification
CS410 – Software Engineering Lecture #9: UML
Chapter 2, Modeling with UML
Presentation transcript:

Chapter 2, Modeling with UML

UML first pass: Class diagrams Class diagrams represent the structure of the system Association Class Multiplicity Watch 1 blinkIdx blinkSeconds() blinkMinutes() blinkHours() stopBlinking() referesh() LCDDisplay 1 Battery load 1 2 1 Time now 2 PushButton state push() release() Attribute Operations

UML Core Conventions Rectangles are classes or instances Ovals are functions or use cases Instances are denoted with an underlined names myWatch:SimpleWatch Joe:Firefighter Types are denoted with non underlined names SimpleWatch Firefighter Diagrams are graphs Nodes are entities Arcs are relationships between entities

Class Diagrams TarifSchedule Trip Enumeration getZones() Price getPrice(Zone) zone:Zone Price: Price * * Class diagrams represent the structure of the system. Used during requirements analysis to model problem domain concepts during system design to model subsystems and interfaces during object design to model classes.

Classes Name Signature Attributes Operations Table zone2price Enumeration getZones() Price getPrice(Zone) TarifSchedule Name zone2price getZones() getPrice() TarifSchedule Attributes Signature Operations TarifSchedule 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.

tarif_1974:TarifSchedule Instances tarif_1974:TarifSchedule zone2price = { {‘1’, .20}, {‘2’, .40}, {‘3’, .60}} 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.

Actor vs Instances What is the difference between an actor , a class and an instance? Actor: An entity outside the system to be modeled, interacting with the system (“Passenger”) 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”).

Associations * * Associations denote relationships between classes. TarifSchedule TripLeg Enumeration getZones() Price getPrice(Zone) Price Zone * * Associations denote relationships between classes. The multiplicity of an association end denotes how many objects the source object can legitimately reference.

1-to-1 and 1-to-many Associations Country 1 City 1 capital name:String name:String One-to-one association Point 1 * Polygon x: Integer y: Integer draw() One-to-many association

Many-to-Many Associations * * Student Course Name Section Term A stock exchange lists many companies each of them uniquely identifed by a ticker symbol used at that stock exchange. A company can be listed on more than one stock exchange, using the same ticker symbol. Mercedes Benz is an example for a company listed on more than one stock exchange: Frankfurt and NYSE. Does it have two different Ticker symbols? Something not clear here: What happens if the company cannot have the same ticker symbol on two different stock exchanges? Many-to-Many

Aggregation An aggregation is a special case of association denoting a “consists of” hierarchy. 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. (Bill of Material) Exhaust system Muffler diameter Tailpipe 1 0..2 Exhaust system 1 0..2 Muffler Tailpipe diameter diameter TicketMachine 3 ZoneButton

Inheritance Button ZoneButton CancelButton The children classes inherit the attributes and operations of the parent class. Inheritance simplifies the model by eliminating redundancy.

Object Modeling in Practice: Class Identification Foo Betrag CustomerId Deposit() Withdraw() GetBalance() Class Identification: Name of Class, Attributes and Methods

Object Modeling in Practice: Encourage Brainstorming “Dada” Betrag CustomerId Deposit() Withdraw() GetBalance() Foo Betrag CustomerId Deposit() Withdraw() GetBalance() Account Betrag CustomerId Deposit() Withdraw() GetBalance() Naming is important! Is Foo the right name?

Object Modeling in Practice ctd Account Betrag Deposit() Withdraw() GetBalance() Customer Name Bank Name CustomerId AccountId CustomerId 1) Find New Objects 2) Iterate on Names, Attributes and Methods

Object Modeling in Practice: A Banking System Account Betrag Deposit() Withdraw() GetBalance() Customer Name CustomerId AccountId Bank * Has 1) Find New Objects 2) Iterate on Names, Attributes and Methods 3) Find Associations between Objects 4) Label the assocations 5) Determine the multiplicity of the assocations

Practice Object Modeling: Iterate, Categorize! Account Amount Deposit() Withdraw() GetBalance() CustomerId AccountId Bank Name Customer Name * * Has CustomerId() Savings Account Withdraw() Checking Account Withdraw() Mortgage Account Withdraw()

Packages 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 DispatcherInterface Notification IncidentManagement

What should be done first? Coding or Modeling? It all depends…. Forward Engineering: Creation of code from a model Greenfield projects 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

UML Summary UML provides a wide variety of notations for representing many aspects of software development Powerful, but complex language Can be misused to generate unreadable models Can be misunderstood when using too many exotic features For now we concentrate on a few notations: Functional model: Use case diagram Object model: class diagram Dynamic model: sequence diagrams, statechart and activity diagrams