Академический Документы
Профессиональный Документы
Культура Документы
Homer
Homer
Homer
Homer Walmart
Walmart
Walmart
Walmart
Lisa
Lisa
Lisa
Lisa Sears
Sears
Sears
Sears
Bart
Bart
Bart
Bart
Student Course
* takes *
1 1
Company BoardOfDirectors
Woman __ __ Child
givesBirthToo
Brother __ Sister
__ has
Country City
0..1 hasCapital 1
Person Colour
* favourite 0..1
…A Colour________________________
…A Person _________________________
successor
isMutuallyExclusiveWith
Course
prerequisite
At TU, you can’t take
At TU, you must have Calc 1301b and
CS2210 and CS2211 to Calc1501b
take CS2212
1
Employee
manager
Responsible worker
for 0..10
Association - Multiplicity
Captain
Team
Mem Player 1 0..1Team
ber 10
11 member of 1
1 Captain
Leads
Association classes
y Sometimes, an attribute that concerns two associated classes cannot b
placed in either of the classes
y The following are equivalent
Spectator * Show
* attended
Player * * SportsGame
participated in
SuperClass
SubClass1 SubClass2
Prey
y A bit better solution, but then we lose the polymorphism advantage for
any operations that differ between FullTimeStudent and
PartTimeStudent:
Student
attendanceStatus
Hari Prasad Pokhrel (hpokhrel24@gmail.com)
Multiple inheritance
Circle
GraphicCircle
Shape
Circle Rectangle
Shape
draw()
Circle Rectangle
draw() draw()
Keyboard Keyboard
}
}
Circle
Point
Move(p:Point)
circleA:Circle
Circle
circleB:Circle
Client
CommandManager
School Department
1 has 1..*
Department Subject
1 offers 1..*
Hari Prasad Pokhrel (hpokhrel24@gmail.com)
Class Diagram - Example
y Department has Instructors and instructors can work
one or more departments.
Instructor Department
1..* assigned to 1..*
Student Subject
* takes 0..5
Hari Prasad Pokhrel (hpokhrel24@gmail.com)
Class Diagram - Example
y Instructors can teach up to 3 subjects.
y The same subject can be taught by different instructors.
1..*
Instructor Subjects
teaches 1..3
*
Student School
member 1..*
School Department
1 1..* 1..*
1…* 1
offeres
assignedTo
member
* 1..* 1..*
attends teaches Instructor
Student Subject
* 1..5 1..31..*
Hari Prasad Pokhrel (hpokhrel24@gmail.com)
Object Diagram
y Object Diagram shows the relationship
between objects.
y Instance
Diagram
France:
Ontario:
isMemberOf isPartOf
isMemberOf
isMemberOf borders
borders
isMemberOf borders
Mexico:
isPartOf New York State:
borders
United States:
PoliticalEntity
name
borders
*
* Territory InterGovernmentalOrganization
* isMemberOf *
1 isPartOf *
Country StateOrProvince
Club 1 * Member
† Marking a part
-whole association as an aggregation using the diamond symbol
is optional. Leaving it as an ordinary association is not an error, whereas
marking a non-aggregation with a diamond is an error, therefore,
when in
doubt, leave it out!
«interface»
Person Cashier Machine Person Machine
withdraw
Cashier Cashier
deposit
Balloons
for Interfaces
y Todetermine
responsibilities
y Performusecaseanalysis
y Lookfor verbsandnounsdescribing
actions
in thesystemdescription
• Modifying attributes of a
flight
• Booking a passenger
• Canceling a booking
Classcollaboration‘a’
… Making a bi-directional
linkbetween
twoexisting
objects
;
… e.g. addinga link betweenan instanceof SpecificFlight
andaninstance
of Airplane .
…
… 1. (public)Theinstance
of SpecificFlight
„ makesa one-directional link to the instanceof Airplane
„ then calls operation 2.
… 2. (non-public)Theinstance
of Airplane
„ makes a one-directional link back to the instance of
SpecificFlight
… Creating
anobject
andlinkingit toanexisting
object
… e.g. creating a FlightLog , and linking it to a
SpecificFlight .
…
… 1. (public)Theinstance
of SpecificFlight
„ calls the constructor of FlightLog (operation 2)
„ then makesa one-directional link to the new instance of
FlightLog .
… 2. (non-public)ClassFlightLog ’s constructor
„ makes a one-directional link back to the instance of
SpecificFlight .
Classcollaboration‘c’
… Creating
anassociation
class,
giventwoexisting
objects
… e.g. creating an instanceof Booking, which will link a
SpecificFlight to aPassengerRole.
… 1. (public)Theinstanceof PassengerRole
„ callstheconstructor
of Booking(operation2).
… 2. (non-public)ClassBooking’sconstructor, amongitsotheractions
„ makesa one-directionallink backto theinstance
of PassengerRole
„ makesa one-directionallink to theinstance
of SpecificFlight
„ callsoperations
3 and4.
… 3. (non-public)Theinstance of SpecificFlight
„ makesa one-directionallink to theinstance
of Booking.
… 4. (non-public)Theinstance of PassengerRole
„ makesa one-directionallink to theinstance
of Booking.
… Changingthedestination
ofalink
… e.g. changing
theAirplane of to a SpecificFlight , from
airplane 1 to airplane 2
… 1. (public)Theinstance
of SpecificFlight
„ deletesthelink to airplane 1
„ makesa one-directionallink to airplane 2
„ callsoperation2
„ thencallsoperation3.
… 2. (non-public)airplane 1
„ deletes itsone-directionallink to theinstance
of SpecificFlight .
… 3. (non-public)airplane 2
„ makes a one-directionallink to theinstance
of SpecificFlight .
HospitalServer:Host
BloodAnalyzer
(COTS) PatientRec
Analyzer update DBMS
TechnicianPC:PC
LabAnalyzer
results
Hari Prasad Pokhrel (hpokhrel24@gmail.com)
Nodes and Components
… Components
are things
that participate in the
execution of a system;
nodesare things that
execute components.
… Components
represent the
physical packaging of
otherwise logical
elements;
nodesrepresent
the physical deployment of
components.
Hari Prasad Pokhrel (hpokhrel24@gmail.com)
Connections
… The most common kind of
relationship you'll use among
nodes is an association.
… In this context, an association
represents a physical connection
among nodes, such as an Ethernet
connection, a serial line, or a
shared bus, as Figure shows
A focus of control is
tall,
a thin rectangle
that shows the period
of time during which an object is performing an action.
«create»
setItinerary(i)
calculateRoute()
route
The first message doesn’t have a participant that sent it, as it comes f
an undetermined source. It’s called
found
a message.
Hari Prasad Pokhrel (hpokhrel24@gmail.com)
Reply or Returns