ECE 355: Software Engineering: Unit 4 (Part 2)
ECE 355: Software Engineering: Unit 4 (Part 2)
ECE 355: Software Engineering: Unit 4 (Part 2)
CHAPTER 2
Unit 4 (Part 2)
element.
component a modular, replaceable and significant
part of a system that packages
implementation and exposes a set of
interfaces.
node a run-time physical object that
represents a computational resource.
Structural Modeling: Core Elements (cont’d)
Suspend()
Flush()
Classes: compartments with names
Reservation
operations
guarantee()
cancel ()
change (newDate: Date)
responsibilities
bill no-shows
match to available rooms
exceptions
invalid credit card
Toolbar
# currentSelection: Tool
# toolCount: Integer
+ pickItem(i: integer)
- compact()
(Owner) Scope
1. Instance: Each instance of the classifier holds its own value
for the feature.
2. Classifier: There is just one value of the feature for all
instances of the classifier.
Frame
instance
Header : FrameHeader
uniqueID : Long classifier
(“static” in Java)
Multiplicity
- Specification of the range of allowable cardinalities
an entity may assume.
NetworkController 1
PoliceStation
alert (Alarm)
1 station
BurglarAlarm
report () { if isTripped
then station.alert(self)}
Open() Event
Close() dependency
HandleEvent()
generalization
association
ConsoleWindow DialogBox Control
DisplayPrompt()
…
Generalization: Alternative notations
Shape
Shape
Shared Target Style
Polygon ...
Ellipse Spline
Vehicle
power venue
power venue
{overlapping} {overlapping}
Truck Sailboat
employee employer
Person Company
Role: face presented to the other class.
More about association
Navigability: An arrow may be attached to the end of the path to
indicate that navigation is supported toward the classifier attached
to the arrow.
Works for
Person Company
More about association
Multiplicity: How many objects may be connected across
an instance of an association.
1..*
Person * Company
employee employer
Company whole
*
Department part
More about association
Composition (composite aggregation):
- An object may be a part of ONLY one composite at a time.
- Whole is responsible for the disposition of its parts.
Window whole
1
*
Frame part
Composition vs Aggregation
Window
1
1 title:Header
1 1
1
scrollbar 2 body:Panel
title 1 body 1
Slider Header Panel
Fig. 3-45, UML Notation Guide
Fig. 3-45, UML Notation Guide
More about association
Job
Description
dateHired
Salary
Ternary Associations
Year
season
Team Player
team goalkeeper
Record
goals for
goals against
wins
losses
ties
Portfolio
Corporation
{secure}
{or}
BankAccount
Person
Constraints and Comments
Member-of
Person {subset} Committee Represents
an incorporated entity.
1 Chair-of
employee employer
0..1
Person Company
0..1
boss
{Person.employer =
Person.boss.employer}
1
Company Department
employer
1 1 department
employer
WorksForDepartment
Person
/WorksForCompany
{ Person.employer=Person.department.employer }
Fig. 3-52, UML Notation Guide
More examples of associations
+vertex
1 3..
Contains
Polygon Point
{ordered}
1
GraphicsBundle
1
-bundle color
texture
density
More examples of associations
Job
Company
employer employee Person
Job boss
salary
0..1
worker
Manages
Person
Fig. 3-40, UML Notation Guide
{X or}
Dependencies
«call» ClassC
«refine»
ClassC combines
two logical classes
ClassD ClassE
IStoreHome Store
IStoreHome Store
POSterminal +create()
<<use>> <<interface>> +login(UserName, Passwd)
POSterminal IStore +find(StoreId)
+getPOStotals(POSid)
+getPOStotals(POSid) +updateStoreTotals(Id,Sales)
+updateStoreTotals(Id,Sales) +get(Item)
+get(Item)
* elements 1 body
«type» «implementationClass»
Set HashTableSet
addElement(Object)
removeElement(Object) addElement(Object)
testElement(Object):Boolean removeElement(Object)
testElement(Object):Boolean
setTableSize(Integer)
OrderBean
<<interface>> {abstract}
EntityBean
+getOrderStatus
+setOrderStatus
PMOrder
+getLineItems
+setLineItems
order +getCreditApproved
+setCreditApproved
* ...
1 order
buyer 1 * item
Customer LineItem
PMLineItem
{abstract}
*
* item
1 commodity
:Multimedia::AudioStream anonymous
multiobject
:keyCode
Object state
myCustomer
Instance with attribute values
Id : SSN = “432 …..”
Active = true
c: Phone
[WaitingForAnswer]
Object diagrams
p: Person : ContactInfo
Name = “jk” Address=“200 U Av.”
Composite objects
awindow : Window
horizontalBar:ScrollBar
verticalBar:ScrollBar
moves
surface:Pane
moves
title:TitleBar
<<EJBSession>>
ShoppingSession ShoppingSession
<<EJBEntity>>
Catalog
CatalogPK
<<auxiliary>>
CatalogPK
CatalogHome CatalogHome
<<focus>>
Catalog
CatalogInfo
Catalog <<auxiliary>>
CatalogInfo
Catalog
<<file>>
CatalogJAR
ShoppingCartHome
ShoppingCart
<<EJBEntity>>
ShoppingCart
Fig. 3-95, UML Notation Guide
UML - Outline
• Introduction
• Structural modeling
– Static structural diagrams
• Class diagrams
• Object diagrams
– Implementation diagrams
• Component diagrams
Deployment diagrams
• Behavioral modeling
• Advanced modeling
Deployment Diagram
• Shows the configuration of run-time
processing elements and the software
components, processes and objects that live
on them
• Deployment diagrams may be used to show
which components may run on which nodes
Deployment Diagram
:Client
<<browser>>
:OpenSourceBrowser
videoStoreServer:AppServer
<<Container>>
VideoStoreApplication
<<Session>> <<Entity>>
ShoppingSession Catalog
<<Focus>> <<Focus>>
ShoppingSession Catalog
<<Entity>>
ShoppingCart
<<Focus>>
ShoppingCart
:DBServer
<<database>>
:VideoStoreDB