SlideShare a Scribd company logo
1 of 19
Class diagram
Account_Name
- Customer_Name
- Balance
+addFunds( )
+withDraw( )
+transfer( )
Name
Attributes
Operations
Lecturer: Najibullah Khadem
OO Relationships
 There are two kinds of Relationships
 Generalization (parent-child relationship)
 Association (student enrolls in course)
 Associations can be further classified as
 Aggregation
 Composition
Lecturer: Najibullah Khadem
Subtype2
Supertype
Subtype1
OO Relationships: Generalization
-Inheritance is a required feature of object orientation
-Generalization expresses a parent/child relationship among related classes.
-Used for abstracting details in several layers
Regular
Customer
Loyalty
Customer
Customer
Example:
Lecturer: Najibullah Khadem
 Represent relationship between instances of classes
 Student enrolls in a course
 Courses have students
 Courses have exams
 Etc.
 Association has two ends
 Role names (e.g. enrolls)
 Multiplicity (e.g. One course can have many students)
 Navigability (unidirectional, bidirectional)
OO Relationships: Association
Lecturer: Najibullah Khadem
Association: Multiplicity and Roles
University Person
1
0..1
*
*
Multiplicity
Symbol Meaning
1 One and only one
0..1 Zero or one
M..N From M to N (natural language)
* From zero to any positive integer
0..* From zero to any positive integer
1..* From one to any positive integer
teacher
employer
Role
Role
“A given university groups many people;
some act as students, others as teachers.
A given student belongs to a single
university; a given teacher may or may not
be working for the university at a particular
time.”
student
Lecturer: Najibullah Khadem
Class diagram
Lecturer: Najibullah Khadem
Association: Model to Implementation
Class Student {
Course enrolls[4];
}
Class Course {
Student have[];
}
Student Course
enrolls
has
* 4
Lecturer: Najibullah Khadem
OO Relationships: Composition
Class W
Class P1 Class P2
Association
Models the part–whole relationship
Composition
Also models the part–whole relationship but, in
addition, Every part may belong to only one
whole, and If the whole is deleted, so are the
parts
Whole Class
Part Classes
Lecturer: Najibullah Khadem
OO Relationships: Aggregation
Class C
Class E1 Class E2
AGGREGATION
Container Class
Containee Classes
Bag
Apples Milk
Example
Aggregation:
expresses a relationship among instances of related
classes. It is a specific kind of Container-
Containee relationship.
express a more informal relationship than
composition expresses.
Aggregation is appropriate when Container and
Containees have no special access privileges to
each other.
Lecturer: Najibullah Khadem
Aggregation vs. Composition
Composition is really a strong form of association
components have only one owner
components cannot exist independent of their owner
components live or die with their owner
e.g. Each car has an engine that can not be shared with other cars.
Aggregations
may form "part of" the association, but may not be essential to it. They
may also exist independent of the aggregate. e.g. Apples may exist
independent of the bag.
Lecturer: Najibullah Khadem
Interaction Diagrams
 show how objects interact with one another
 UML supports two types of interaction
diagrams
 Sequence diagrams
 Collaboration diagrams
Lecturer: Najibullah Khadem
Sequence Diagram(make a phone call)
Caller Phone Recipient
Picks up
Dial tone
Dial
Ring notification Ring
Picks up
Hello
Lecturer: Najibullah Khadem
Sequence Diagram:Object interaction
Self-Call: A message that an
Object sends to itself.
Condition: indicates when a
message is sent. The message is
sent only if the condition is true.
Iteration
Condition
A B
Synchronous
Asynchronous
Transmission
delayed
Self-Call
[condition] remove()
*[for each] remove()
Lecturer: Najibullah Khadem
Sequence Diagrams – Object Life Spans
 Creation
 Create message
 Object life starts at that point
 Activation
 Symbolized by rectangular stripes
 Place on the lifeline where object
is activated.
 Rectangle also denotes when
object is deactivated.
 Deletion
 Placing an ‘X’ on lifeline
 Object’s life ends at that point
Activation bar
A
B
Create
X
Deletion
Return
Lifeline
Lecturer: Najibullah Khadem
Sequence Diagram
User Catalog Reservations
1: look up ()
2: title data ()
3: [not available] reserve title ()
4 : title returned ()
5: hold title ()
5 : title available ()
6 : borrow title ()
6 : remove reservation ()
•Sequence diagrams demonstrate
the behavior of objects in a use case
by describing the objects and the
messages they pass.
•The horizontal dimension shows the
objects participating in the interaction.
•The vertical arrangement of
messages indicates their order.
•The labels may contain the seq. # to
indicate concurrency.
Message
Lecturer: Najibullah Khadem
Interaction Diagrams: Collaboration diagrams
User
Catalog
Reservations
start
1: look up
2: title data
3 : [not available] reserve title
4 : title returned
5 : hold title
6 : borrow title
6: remove reservation
5: title available
Collaboration diagrams are equivalent to sequence diagrams. All the features of sequence
diagrams are equally applicable to collaboration diagrams
Use a sequence diagram when the transfer of information is the focus of attention
Use a collaboration diagram when concentrating on the classes
Lecturer: Najibullah Khadem
State Diagrams (Billing Example)
State Diagrams show the sequences of states an object goes through
during its life cycle in response to stimuli, together with its responses and
actions; an abstraction of all possible behaviors.
Unpaid
Start End
Paid
Invoice created paying Invoice destroying
Lecturer: Najibullah Khadem
State Diagrams (Traffic light example)
Yellow
Red
Green
Traffic Light
State
Transition
Event
Start
Lecturer: Najibullah Khadem
Thank you
Questions?
Lecturer: Najibullah Khadem

More Related Content

Similar to Software Engineering1-1-UML.ppt

Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
Aravinth NSP
 

Similar to Software Engineering1-1-UML.ppt (20)

Uml lecture
Uml lectureUml lecture
Uml lecture
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
UML Training for Business Analysts
UML Training for Business AnalystsUML Training for Business Analysts
UML Training for Business Analysts
 
2 class use case
2 class use case2 class use case
2 class use case
 
Intro Uml
Intro UmlIntro Uml
Intro Uml
 
Introduction to OOA and UML
Introduction to OOA and UMLIntroduction to OOA and UML
Introduction to OOA and UML
 
Introduction to OOA and UML
Introduction to OOA and UMLIntroduction to OOA and UML
Introduction to OOA and UML
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Jar chapter 2
Jar chapter 2Jar chapter 2
Jar chapter 2
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
OMD chapter 2 Class modelling
 OMD  chapter 2 Class modelling OMD  chapter 2 Class modelling
OMD chapter 2 Class modelling
 
Class diagram presentation
Class diagram presentationClass diagram presentation
Class diagram presentation
 
Descriptions of class diagrams in software
Descriptions of class diagrams in softwareDescriptions of class diagrams in software
Descriptions of class diagrams in software
 
Sda 7
Sda   7Sda   7
Sda 7
 
06 class diagrams
06 class diagrams06 class diagrams
06 class diagrams
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manual
 
Lecture 4-oop class diagram
Lecture 4-oop class diagramLecture 4-oop class diagram
Lecture 4-oop class diagram
 
Relations Class Diagram
Relations Class DiagramRelations Class Diagram
Relations Class Diagram
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 

Recently uploaded

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Recently uploaded (20)

Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

Software Engineering1-1-UML.ppt

  • 1. Class diagram Account_Name - Customer_Name - Balance +addFunds( ) +withDraw( ) +transfer( ) Name Attributes Operations Lecturer: Najibullah Khadem
  • 2. OO Relationships  There are two kinds of Relationships  Generalization (parent-child relationship)  Association (student enrolls in course)  Associations can be further classified as  Aggregation  Composition Lecturer: Najibullah Khadem
  • 3. Subtype2 Supertype Subtype1 OO Relationships: Generalization -Inheritance is a required feature of object orientation -Generalization expresses a parent/child relationship among related classes. -Used for abstracting details in several layers Regular Customer Loyalty Customer Customer Example: Lecturer: Najibullah Khadem
  • 4.  Represent relationship between instances of classes  Student enrolls in a course  Courses have students  Courses have exams  Etc.  Association has two ends  Role names (e.g. enrolls)  Multiplicity (e.g. One course can have many students)  Navigability (unidirectional, bidirectional) OO Relationships: Association Lecturer: Najibullah Khadem
  • 5. Association: Multiplicity and Roles University Person 1 0..1 * * Multiplicity Symbol Meaning 1 One and only one 0..1 Zero or one M..N From M to N (natural language) * From zero to any positive integer 0..* From zero to any positive integer 1..* From one to any positive integer teacher employer Role Role “A given university groups many people; some act as students, others as teachers. A given student belongs to a single university; a given teacher may or may not be working for the university at a particular time.” student Lecturer: Najibullah Khadem
  • 7. Association: Model to Implementation Class Student { Course enrolls[4]; } Class Course { Student have[]; } Student Course enrolls has * 4 Lecturer: Najibullah Khadem
  • 8. OO Relationships: Composition Class W Class P1 Class P2 Association Models the part–whole relationship Composition Also models the part–whole relationship but, in addition, Every part may belong to only one whole, and If the whole is deleted, so are the parts Whole Class Part Classes Lecturer: Najibullah Khadem
  • 9. OO Relationships: Aggregation Class C Class E1 Class E2 AGGREGATION Container Class Containee Classes Bag Apples Milk Example Aggregation: expresses a relationship among instances of related classes. It is a specific kind of Container- Containee relationship. express a more informal relationship than composition expresses. Aggregation is appropriate when Container and Containees have no special access privileges to each other. Lecturer: Najibullah Khadem
  • 10. Aggregation vs. Composition Composition is really a strong form of association components have only one owner components cannot exist independent of their owner components live or die with their owner e.g. Each car has an engine that can not be shared with other cars. Aggregations may form "part of" the association, but may not be essential to it. They may also exist independent of the aggregate. e.g. Apples may exist independent of the bag. Lecturer: Najibullah Khadem
  • 11. Interaction Diagrams  show how objects interact with one another  UML supports two types of interaction diagrams  Sequence diagrams  Collaboration diagrams Lecturer: Najibullah Khadem
  • 12. Sequence Diagram(make a phone call) Caller Phone Recipient Picks up Dial tone Dial Ring notification Ring Picks up Hello Lecturer: Najibullah Khadem
  • 13. Sequence Diagram:Object interaction Self-Call: A message that an Object sends to itself. Condition: indicates when a message is sent. The message is sent only if the condition is true. Iteration Condition A B Synchronous Asynchronous Transmission delayed Self-Call [condition] remove() *[for each] remove() Lecturer: Najibullah Khadem
  • 14. Sequence Diagrams – Object Life Spans  Creation  Create message  Object life starts at that point  Activation  Symbolized by rectangular stripes  Place on the lifeline where object is activated.  Rectangle also denotes when object is deactivated.  Deletion  Placing an ‘X’ on lifeline  Object’s life ends at that point Activation bar A B Create X Deletion Return Lifeline Lecturer: Najibullah Khadem
  • 15. Sequence Diagram User Catalog Reservations 1: look up () 2: title data () 3: [not available] reserve title () 4 : title returned () 5: hold title () 5 : title available () 6 : borrow title () 6 : remove reservation () •Sequence diagrams demonstrate the behavior of objects in a use case by describing the objects and the messages they pass. •The horizontal dimension shows the objects participating in the interaction. •The vertical arrangement of messages indicates their order. •The labels may contain the seq. # to indicate concurrency. Message Lecturer: Najibullah Khadem
  • 16. Interaction Diagrams: Collaboration diagrams User Catalog Reservations start 1: look up 2: title data 3 : [not available] reserve title 4 : title returned 5 : hold title 6 : borrow title 6: remove reservation 5: title available Collaboration diagrams are equivalent to sequence diagrams. All the features of sequence diagrams are equally applicable to collaboration diagrams Use a sequence diagram when the transfer of information is the focus of attention Use a collaboration diagram when concentrating on the classes Lecturer: Najibullah Khadem
  • 17. State Diagrams (Billing Example) State Diagrams show the sequences of states an object goes through during its life cycle in response to stimuli, together with its responses and actions; an abstraction of all possible behaviors. Unpaid Start End Paid Invoice created paying Invoice destroying Lecturer: Najibullah Khadem
  • 18. State Diagrams (Traffic light example) Yellow Red Green Traffic Light State Transition Event Start Lecturer: Najibullah Khadem