OOSE - Week 6 - Class Diagram
OOSE - Week 6 - Class Diagram
OOSE - Week 6 - Class Diagram
Material based on
[Booch99, Rambaugh99, Jacobson99, Fowler97, Brown99]
Software Design (UML)
SERG
Class
Component
Deployment
Object
Composite structure
Package
Behavioral
: behavioral features of a system / business
process
Activity
State machine
Use case
Interaction
Interaction
: emphasize object interaction
Communication(collabe
ration)
Sequence
Interaction overview
Timing
SERG
Classes
ClassName
attributes
operations
SERG
Class Names
ClassName
attributes
operations
SERG
Class Attributes
Person
name
: String
address : Address
birthdate : Date
ssn
: Id
SERG
SERG
Class Operations
Person
name
: String
address : Address
birthdate : Date
ssn
: Id
eat
sleep
work
play
SERG
Depicting Classes
When drawing a class, you neednt show attributes and operation
in every diagram.
Person
Person
name
: String
birthdate : Date
ssn
: Id
Person
name
address
birthdate
Person
Person
eat
play
eat()
sleep()
work()
play()
SERG
Relationships
In UML, object interconnections (logical or physical), are
modeled as relationships.
There are three kinds of relationships in UML:
dependencies
generalizations
associations
aggregation
composition
Software Design (UML)
SERG
Dependency Relationships
A dependency indicates a semantic relationship between two or
more elements. The dependency from CourseSchedule to
Course exists because Course is used in both the add and
remove operations of CourseSchedule.
CourseSchedule
Course
add(c : Course)
remove(c : Course)
SERG
Generalization Relationships
Person
Student
SERG
Association Relationships
If two classes in a model need to communicate with each other,
there must be link between them.
An association denotes that link.
Student
Instructor
SERG
1..*
Instructor
SERG
Student
1..*
Instructor
SERG
Student
teaches
1..*
learns from
1..*
Instructor
SERG
Student
membership
1..*
1..*
Team
SERG
member of
Student
1..*
1
1..*
president of
Team
1..*
SERG
Transmission
SERG
Window
1 .. *
Scrollbar
Titlebar
Menu
SERG
Association/Composition Example
SERG
SERG
Case Study 1
A laboratory has several chemists who work on one or more
projects. Chemists (empid, Name, Phone_no) also may use
certain kinds of equipments (Serial_no, cost) on each project
(projected, start_date). The organization wishes to record
assign-date i.e., the date when the given equipment item was
assigned to a particular Chemist working on a specific project,
as well as total number of hours the chemist has used the
equipment for the project. The chemist must be assigned to at
least one project and one equipment item. Draw the class
diagram.
SERG
Case Study 2
POST OFFICE Management System- This simple website
holds the account information of the users and their details. It
also provide the details of the branches and also the
employees. It also provides the various type of bonds present
and term period. Rules and regulations can be viewed by
anyone. The user can login to this website. This also depicts to
send a telegram via credit card. Draw class diagram.
SERG