Chapter 6: Class Diagrams
Objectives Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. Understand the processes used to create CRC cards, class diagrams, and object diagrams. Be able to create CRC cards, class diagrams, and object diagrams. Understand the relationship between the structural and use case models.
Structural Model A formal way of representing the objects that are used and created by a business system People Places Things Drawn using an iterative process First drawn in a conceptual, business-centric way Then refined in a technology-centric way describing the actual databases and files
STRUCTURAL MODELS
Structural Models Main goal : to discover the key data contained in the problem domain and to build a structural model of the objects Problem Domain Solution Domain Structural Modeling
A Common Language Structural models create a well-defined vocabulary  shared by users and analysts Classes created during analysis are not the classes that programmers develop during implementation This refinement comes later Typical structural models: CRC cards Class (and Object) diagrams
Classes, Attributes, & Operations Classes Templates for instances of people, places, or things Attributes Properties that describe the state of an instance of a class (an object) Operations Actions or functions that a class can perform
Relationships Describe how classes relate to one another Three basic types in UML Generalization  Enables  inheritance  of attributes and operations Aggregation Relates parts to wholes Association Miscellaneous relationships between classes
CRC CARDS
Responsibilities & Collaborations Responsibilities Knowing Doing Collaboration Objects working together to service a request
Front-Side of a CRC Card
Back-Side of a CRC Card
CLASS DIAGRAMS
Elements of a Class Diagram
Attribute Visibility Attribute visibility can be specified in the class diagram Public attributes (+) are visible to all classes Private attributes (-) are visible only to an instance of the class in which they are defined Protected attributes (#) are like private attributes, but are also visible to descendant classes Visibility helps restrict access to the attributes and thus ensure consistency and integrity
Operations Constructor Creates object Query Makes information about state available Update Changes values of some or all attributes
More Elements of Class Diagrams
Multiplicities 1 1 1 0..* 1 1..* Exactly one: A department has one and only one boss Zero or more: An employee has zero to many children One or more: A boss is responsible for one or more employees Department Boss Employee Child Boss Employee
More Multiplicities 1 0..1 1 2..4 1 1..3, 5 Zero or one: An employee can be married to 0 or 1 spouse Specified range: An employee can take 2 to 4 vacations each year Multiple disjoint ranges: An employee can be in 1 to 3 or 5 committees Employee Spouse Employee Vacation Employee Committee
Sample Class Diagram
Simplifying Class Diagrams Fully populated class diagrams of real-world system can be difficult to understand Common ways of simplifying class diagrams: Show only concrete classes The view mechanism shows a subset of classes Packages show aggregations of classes (or any elements in UML)
Object Diagrams
CREATING CRC CARDS AND CLASS DIAGRAMS
Object Identification Textual analysis of use-case information Nouns suggest classes Verbs suggest operations Creates a rough first cut Common object list Incidents Roles
Patterns Useful groupings of classes that recur in various situations Transactions Transaction class Transaction line item class Item class Location class Participant class
7 Steps to Structural Models Create CRC Cards Examine common object lists Role-play the CRC cards Create the class diagram Review the class diagram Incorporate patterns Review the model
Summary Structural Models CRC Cards Class Diagrams Creating CRC Cards and Class Diagrams

More Related Content

PPTX
class diagram
PPTX
Class diagram
PDF
2 class use case
PPT
Slide 5 Class Diagram
PPTX
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
PPTX
Object oriented architecture in erp
PPT
Domain object model
PDF
Class diagram- UML diagram
class diagram
Class diagram
2 class use case
Slide 5 Class Diagram
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
Object oriented architecture in erp
Domain object model
Class diagram- UML diagram

What's hot (20)

PPTX
Ooad ppt
PPT
classes & objects introduction
PPT
1Introduction to OOAD
PPT
Class diagrams
PPT
Relations Class Diagram
PPTX
Overview of UML Diagrams
PPTX
Different Types Diagrams
PPT
Lecture 03 data abstraction and er model
PPT
Object Oriented Analysis and Design
PDF
SE_Lec 07_UML CLASS DIAGRAM
PPTX
Uml diagram assignment help
PPT
Class diagrams
PPT
Ch 5 O O Data Modeling
PPTX
Brief introduction to Object Oriented Analysis and Design
PPT
Ch 3 E R Model
PPTX
Introduction to object-oriented analysis and design (OOA/D)
PPTX
Uml Presentation
PDF
Object oriented software engineering concepts
PDF
Software Engineering :UML class diagrams
Ooad ppt
classes & objects introduction
1Introduction to OOAD
Class diagrams
Relations Class Diagram
Overview of UML Diagrams
Different Types Diagrams
Lecture 03 data abstraction and er model
Object Oriented Analysis and Design
SE_Lec 07_UML CLASS DIAGRAM
Uml diagram assignment help
Class diagrams
Ch 5 O O Data Modeling
Brief introduction to Object Oriented Analysis and Design
Ch 3 E R Model
Introduction to object-oriented analysis and design (OOA/D)
Uml Presentation
Object oriented software engineering concepts
Software Engineering :UML class diagrams
Ad

Similar to Ch06 (20)

PDF
Class diagram and its importance in software
DOCX
Chapterunifiedmo 3 UML Class Diagram.docx
PPT
SDA ClassDiagram.ppt
PPTX
Lecture 06.pptxLecture 06.pptxLecture 06.pptx
PPT
ClassDiagram.pptxaabbxcddeeddfftttygtyyy
PPTX
OOP_Module 2.pptx
PPTX
UML Design.pptx
PPTX
Unified Modeling Language and Examples .pptx
PPTX
210280107093_CLASS_DIAGRAM.pptx
PPTX
Relationships and their representation in a class diagram.pptx
PPT
UML for OOAD
PPT
ASP.NET System design 2
PDF
OBJECT ORIENTED CONCEPTS,UML DIAGRAMS,DFD
PPTX
Class Diagrams
PPT
Chapter 2-Unified Modeling Languagee.ppt
PPT
Chapter 2-Unified Modeling Languagee.ppt
PPTX
SMD Unit ii
PPTX
Slideshow on the notes of software engineering
PPTX
1. introduction to uml
PPT
Class diagram and its importance in software
Chapterunifiedmo 3 UML Class Diagram.docx
SDA ClassDiagram.ppt
Lecture 06.pptxLecture 06.pptxLecture 06.pptx
ClassDiagram.pptxaabbxcddeeddfftttygtyyy
OOP_Module 2.pptx
UML Design.pptx
Unified Modeling Language and Examples .pptx
210280107093_CLASS_DIAGRAM.pptx
Relationships and their representation in a class diagram.pptx
UML for OOAD
ASP.NET System design 2
OBJECT ORIENTED CONCEPTS,UML DIAGRAMS,DFD
Class Diagrams
Chapter 2-Unified Modeling Languagee.ppt
Chapter 2-Unified Modeling Languagee.ppt
SMD Unit ii
Slideshow on the notes of software engineering
1. introduction to uml
Ad

More from 蕭美蓮 (19)

PPT
Ch01
PPT
Ch01
PPT
Ch14
PPT
Ch13
PPT
Ch12
PPT
Ch11
PPT
Ch10
PPT
Ch09
PPT
Ch08
PPT
Ch07
PPT
Ch05
PPT
Ch04
PPT
Ch03
PPT
Ch02
PPT
Ch10
DOCX
完整資料表
PPT
Web2
DOCX
專案管理心得
PPT
Acer1
Ch01
Ch01
Ch14
Ch13
Ch12
Ch11
Ch10
Ch09
Ch08
Ch07
Ch05
Ch04
Ch03
Ch02
Ch10
完整資料表
Web2
專案管理心得
Acer1

Ch06

  • 1. Chapter 6: Class Diagrams
  • 2. Objectives Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. Understand the processes used to create CRC cards, class diagrams, and object diagrams. Be able to create CRC cards, class diagrams, and object diagrams. Understand the relationship between the structural and use case models.
  • 3. Structural Model A formal way of representing the objects that are used and created by a business system People Places Things Drawn using an iterative process First drawn in a conceptual, business-centric way Then refined in a technology-centric way describing the actual databases and files
  • 5. Structural Models Main goal : to discover the key data contained in the problem domain and to build a structural model of the objects Problem Domain Solution Domain Structural Modeling
  • 6. A Common Language Structural models create a well-defined vocabulary shared by users and analysts Classes created during analysis are not the classes that programmers develop during implementation This refinement comes later Typical structural models: CRC cards Class (and Object) diagrams
  • 7. Classes, Attributes, & Operations Classes Templates for instances of people, places, or things Attributes Properties that describe the state of an instance of a class (an object) Operations Actions or functions that a class can perform
  • 8. Relationships Describe how classes relate to one another Three basic types in UML Generalization Enables inheritance of attributes and operations Aggregation Relates parts to wholes Association Miscellaneous relationships between classes
  • 10. Responsibilities & Collaborations Responsibilities Knowing Doing Collaboration Objects working together to service a request
  • 11. Front-Side of a CRC Card
  • 12. Back-Side of a CRC Card
  • 14. Elements of a Class Diagram
  • 15. Attribute Visibility Attribute visibility can be specified in the class diagram Public attributes (+) are visible to all classes Private attributes (-) are visible only to an instance of the class in which they are defined Protected attributes (#) are like private attributes, but are also visible to descendant classes Visibility helps restrict access to the attributes and thus ensure consistency and integrity
  • 16. Operations Constructor Creates object Query Makes information about state available Update Changes values of some or all attributes
  • 17. More Elements of Class Diagrams
  • 18. Multiplicities 1 1 1 0..* 1 1..* Exactly one: A department has one and only one boss Zero or more: An employee has zero to many children One or more: A boss is responsible for one or more employees Department Boss Employee Child Boss Employee
  • 19. More Multiplicities 1 0..1 1 2..4 1 1..3, 5 Zero or one: An employee can be married to 0 or 1 spouse Specified range: An employee can take 2 to 4 vacations each year Multiple disjoint ranges: An employee can be in 1 to 3 or 5 committees Employee Spouse Employee Vacation Employee Committee
  • 21. Simplifying Class Diagrams Fully populated class diagrams of real-world system can be difficult to understand Common ways of simplifying class diagrams: Show only concrete classes The view mechanism shows a subset of classes Packages show aggregations of classes (or any elements in UML)
  • 23. CREATING CRC CARDS AND CLASS DIAGRAMS
  • 24. Object Identification Textual analysis of use-case information Nouns suggest classes Verbs suggest operations Creates a rough first cut Common object list Incidents Roles
  • 25. Patterns Useful groupings of classes that recur in various situations Transactions Transaction class Transaction line item class Item class Location class Participant class
  • 26. 7 Steps to Structural Models Create CRC Cards Examine common object lists Role-play the CRC cards Create the class diagram Review the class diagram Incorporate patterns Review the model
  • 27. Summary Structural Models CRC Cards Class Diagrams Creating CRC Cards and Class Diagrams