SlideShare ist ein Scribd-Unternehmen logo
1 von 19
UNIT I UML DIAGRAMS
Introduction to OOAD – Unified Process –
UML diagrams – Use Case – Class Diagrams–
Interaction Diagrams – State Diagrams –
Activity Diagrams –
Package, component and Deployment Diagrams.
Class Diagram
A type of static structure diagram
that describes the structure of a system
Class Diagram
• Class diagram is a static diagram
– It represents the static view of an application
• Class diagram shows a collection of classes, interfaces, associations,
collaborations and constraints.
– It is also known as a structural diagram.
• Purpose of Class Diagram
– Analysis and design of the static view of an application.
– Describe responsibilities of a system.
– Base for component and deployment diagrams.
– Forward and reverse engineering.
Class Diagram
• A no. of classes are identified & grouped together in a class diagram
– That helps to determine the static relations between them.
• To further describe the behavior of systems,
– Class diagrams can be complemented by a state diagram or UML
state machine.
Notations in Class Diagram
• It shows the
1. Classes in a system,
2. Attributes and operations of each class and
3. Relationship between each class.
• Classes are represented as boxes with 3 sections
– Name at the top,
– Attributes in the middle and
– Operations or methods at
the bottom
Notations - Members Visibility
• To specify the visibility of a class member
(i.e. any attribute or method),
– These notations must be placed before the member's name
+ Public
- Private
# Protected
/
Derived (can be
combined with one
of the others)
~ Package
Relationships
• A relationship covers the specific types of logical connections
found on class and object diagrams.
• UML shows the following relationships:
Dependency
– Connection b/w dependent and independent model elements
– Dependency is represented by a dotted arrow
– Arrow head represents the independent element and the other end the
dependent element.
Association
• Represent the relationship b/w two elements of a system
– Describes how the elements in an UML diagram are associated
– Represented by a dotted line with (without) arrows on both sides
– Multiplicity is mentioned at the ends
Multiplicity in UML
• Multiplicity allows to specify cardinality
i.e. number of elements - of some collection of elements.
• Multiplicity interval has some lower bound and upper bound
• Some typical examples of multiplicity
Multiplicity Option Cardinality
0..0 0 Collection must be empty
0..1 No instances or one instance
1..1 1 Exactly one instance
0..* * Zero or more instances
1..* At least one instance
5..5 5 Exactly 5 instances
m..n At least m but no more than n instances
Example
Two or more Player actors are required
to initiate Play Game use case.
Multiplicity of Players for Soccer Team class
Aggregation
• Aggregation is a special case of association.
• When an object ‘has-a’ another object,
– Then you have got an aggregation between them.
• Direction specifies which object contains the other object.
• Aggregation is also called a “Has-a” relationship
Example:
A Library contains students and books.
Relationship b/w library and student is aggregation.
Composition
• Composition is a special case of aggregation.
• When an object contains the other object,
– If the contained object cannot exist without the existence of container object, then it is called composition.
Folder could contain many files,
while each File has exactly one Folder parent.
If Folder is deleted, all contained Files are deleted as well.
Hospital has 1 or more Departments,
Each Department belongs to exactly one Hospital.
If Hospital is closed, so are all of its Departments.
Example:
A Library contains students and books.
Relationship between library and book is composition.
A student can exist without a library and therefore it is aggregation.
A book cannot exist without a library and therefore its a composition.
Generalization
• Generalization uses a “is-a” relationship
• At a very broader level you can understand this as inheritance.
Example:
Consider there exists a class named Person.
A student is a person.
A faculty is a person.
Here the relationship b/w student & person, similarly faculty & person is generalization.
shared target style.separate target style
Realization
• A realization relationship is a relationship between two model element
– One element (client) realizes (implements) the behavior that the other element (supplier) specifies.
• In OOP, realization represents the implementation of an interface by a class.
06 class diagrams
06 class diagrams
06 class diagrams
06 class diagrams

Weitere ähnliche Inhalte

Was ist angesagt?

Ch 5 O O Data Modeling
Ch 5  O O  Data ModelingCh 5  O O  Data Modeling
Ch 5 O O Data Modeling
guest8fdbdd
 
Entity relationship modelling - DE L300
Entity relationship modelling - DE L300Entity relationship modelling - DE L300
Entity relationship modelling - DE L300
Edwin Ayernor
 

Was ist angesagt? (20)

ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
Ch 5 O O Data Modeling
Ch 5  O O  Data ModelingCh 5  O O  Data Modeling
Ch 5 O O Data Modeling
 
Class diagram
Class diagramClass diagram
Class diagram
 
Class Diagram
Class DiagramClass Diagram
Class Diagram
 
2 class use case
2 class use case2 class use case
2 class use case
 
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
 
Object Oriented Relationships
Object Oriented RelationshipsObject Oriented Relationships
Object Oriented Relationships
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Class diagram- UML diagram
Class diagram- UML diagramClass diagram- UML diagram
Class diagram- UML diagram
 
E R model
E R modelE R model
E R model
 
Uml class Diagram
Uml class DiagramUml class Diagram
Uml class Diagram
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
Object diagram
Object diagramObject diagram
Object diagram
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Er model
Er modelEr model
Er model
 
E-R Diagram of College Management Systems
E-R Diagram of College Management SystemsE-R Diagram of College Management Systems
E-R Diagram of College Management Systems
 
Entity relationship modelling - DE L300
Entity relationship modelling - DE L300Entity relationship modelling - DE L300
Entity relationship modelling - DE L300
 
Uml class diagram and packages ppt for dot net
Uml class diagram and packages ppt for dot netUml class diagram and packages ppt for dot net
Uml class diagram and packages ppt for dot net
 
Class diagram
Class diagramClass diagram
Class diagram
 

Ähnlich wie 06 class diagrams

Relationships and their representation in a class diagram.pptx
Relationships and their representation in a class diagram.pptxRelationships and their representation in a class diagram.pptx
Relationships and their representation in a class diagram.pptx
nesarahmad37
 
Session13-Class Diagram (1).pdf
Session13-Class Diagram (1).pdfSession13-Class Diagram (1).pdf
Session13-Class Diagram (1).pdf
PeterTran514407
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
kebsterz
 
Lecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASELecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASE
babak danyal
 
UNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptxUNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptx
viju001
 

Ähnlich wie 06 class diagrams (20)

UML-class_diagram.ppt
UML-class_diagram.pptUML-class_diagram.ppt
UML-class_diagram.ppt
 
UML-class diagram for beginners to adance.ppt
UML-class diagram for beginners to adance.pptUML-class diagram for beginners to adance.ppt
UML-class diagram for beginners to adance.ppt
 
Relationships and their representation in a class diagram.pptx
Relationships and their representation in a class diagram.pptxRelationships and their representation in a class diagram.pptx
Relationships and their representation in a class diagram.pptx
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
 
classdiagram.pptx
classdiagram.pptxclassdiagram.pptx
classdiagram.pptx
 
Uml package diagram
Uml package  diagramUml package  diagram
Uml package diagram
 
Claas diagram
Claas diagramClaas diagram
Claas diagram
 
Claas diagram
Claas diagramClaas diagram
Claas diagram
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manual
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Session13-Class Diagram (1).pdf
Session13-Class Diagram (1).pdfSession13-Class Diagram (1).pdf
Session13-Class Diagram (1).pdf
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbols
 
OOP_Module 2.pptx
OOP_Module 2.pptxOOP_Module 2.pptx
OOP_Module 2.pptx
 
Lecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASELecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASE
 
UNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptxUNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptx
 
Css uml
Css umlCss uml
Css uml
 
Chapter3
Chapter3Chapter3
Chapter3
 
Object Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLObject Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UML
 
Ooad ch 3
Ooad ch 3Ooad ch 3
Ooad ch 3
 

Mehr von Baskarkncet (20)

Unit_I.pptx
Unit_I.pptxUnit_I.pptx
Unit_I.pptx
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Unit 1
Unit 1Unit 1
Unit 1
 
HCI
HCIHCI
HCI
 
03 x files
03 x files03 x files
03 x files
 
03 namespace
03 namespace03 namespace
03 namespace
 
02 xml schema
02 xml schema02 xml schema
02 xml schema
 
02 well formed and valid documents
02 well formed and valid documents02 well formed and valid documents
02 well formed and valid documents
 
00 introduction
00 introduction00 introduction
00 introduction
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
11 deployment diagrams
11 deployment diagrams11 deployment diagrams
11 deployment diagrams
 
10 component diagram
10 component diagram10 component diagram
10 component diagram
 
09 package diagram
09 package diagram09 package diagram
09 package diagram
 
08 state diagram and activity diagram
08 state diagram and activity diagram08 state diagram and activity diagram
08 state diagram and activity diagram
 
07 interaction diagrams
07 interaction diagrams07 interaction diagrams
07 interaction diagrams
 
05 use case
05 use case05 use case
05 use case
 
03 unified process
03 unified process03 unified process
03 unified process
 
02 uml
02 uml02 uml
02 uml
 
04 uml diagrams
04 uml diagrams04 uml diagrams
04 uml diagrams
 
01 introduction
01 introduction01 introduction
01 introduction
 

Kürzlich hochgeladen

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
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
 
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
 

Kürzlich hochgeladen (20)

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
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
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
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
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 

06 class diagrams

  • 1. UNIT I UML DIAGRAMS Introduction to OOAD – Unified Process – UML diagrams – Use Case – Class Diagrams– Interaction Diagrams – State Diagrams – Activity Diagrams – Package, component and Deployment Diagrams.
  • 2. Class Diagram A type of static structure diagram that describes the structure of a system
  • 3. Class Diagram • Class diagram is a static diagram – It represents the static view of an application • Class diagram shows a collection of classes, interfaces, associations, collaborations and constraints. – It is also known as a structural diagram. • Purpose of Class Diagram – Analysis and design of the static view of an application. – Describe responsibilities of a system. – Base for component and deployment diagrams. – Forward and reverse engineering.
  • 4. Class Diagram • A no. of classes are identified & grouped together in a class diagram – That helps to determine the static relations between them. • To further describe the behavior of systems, – Class diagrams can be complemented by a state diagram or UML state machine.
  • 5. Notations in Class Diagram • It shows the 1. Classes in a system, 2. Attributes and operations of each class and 3. Relationship between each class. • Classes are represented as boxes with 3 sections – Name at the top, – Attributes in the middle and – Operations or methods at the bottom
  • 6. Notations - Members Visibility • To specify the visibility of a class member (i.e. any attribute or method), – These notations must be placed before the member's name + Public - Private # Protected / Derived (can be combined with one of the others) ~ Package
  • 7. Relationships • A relationship covers the specific types of logical connections found on class and object diagrams. • UML shows the following relationships:
  • 8. Dependency – Connection b/w dependent and independent model elements – Dependency is represented by a dotted arrow – Arrow head represents the independent element and the other end the dependent element.
  • 9. Association • Represent the relationship b/w two elements of a system – Describes how the elements in an UML diagram are associated – Represented by a dotted line with (without) arrows on both sides – Multiplicity is mentioned at the ends
  • 10. Multiplicity in UML • Multiplicity allows to specify cardinality i.e. number of elements - of some collection of elements. • Multiplicity interval has some lower bound and upper bound • Some typical examples of multiplicity Multiplicity Option Cardinality 0..0 0 Collection must be empty 0..1 No instances or one instance 1..1 1 Exactly one instance 0..* * Zero or more instances 1..* At least one instance 5..5 5 Exactly 5 instances m..n At least m but no more than n instances
  • 11. Example Two or more Player actors are required to initiate Play Game use case. Multiplicity of Players for Soccer Team class
  • 12. Aggregation • Aggregation is a special case of association. • When an object ‘has-a’ another object, – Then you have got an aggregation between them. • Direction specifies which object contains the other object. • Aggregation is also called a “Has-a” relationship Example: A Library contains students and books. Relationship b/w library and student is aggregation.
  • 13. Composition • Composition is a special case of aggregation. • When an object contains the other object, – If the contained object cannot exist without the existence of container object, then it is called composition. Folder could contain many files, while each File has exactly one Folder parent. If Folder is deleted, all contained Files are deleted as well. Hospital has 1 or more Departments, Each Department belongs to exactly one Hospital. If Hospital is closed, so are all of its Departments. Example: A Library contains students and books. Relationship between library and book is composition. A student can exist without a library and therefore it is aggregation. A book cannot exist without a library and therefore its a composition.
  • 14. Generalization • Generalization uses a “is-a” relationship • At a very broader level you can understand this as inheritance. Example: Consider there exists a class named Person. A student is a person. A faculty is a person. Here the relationship b/w student & person, similarly faculty & person is generalization. shared target style.separate target style
  • 15. Realization • A realization relationship is a relationship between two model element – One element (client) realizes (implements) the behavior that the other element (supplier) specifies. • In OOP, realization represents the implementation of an interface by a class.