0% found this document useful (0 votes)
101 views12 pages

5.2 Class Diagram Design

The document provides guidelines for analyzing requirements and use cases to develop effective class diagrams, including identifying classes from common nouns, adjectives indicating attributes, and verbs indicating operations. It discusses ensuring classes are necessary and sufficient, and discarding unnecessary classes like those that are redundant, irrelevant, or vague. Examples are given of properly structured class diagrams for a video rental system and other examples to illustrate class relationships like generalization, aggregation, and association.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views12 pages

5.2 Class Diagram Design

The document provides guidelines for analyzing requirements and use cases to develop effective class diagrams, including identifying classes from common nouns, adjectives indicating attributes, and verbs indicating operations. It discusses ensuring classes are necessary and sufficient, and discarding unnecessary classes like those that are redundant, irrelevant, or vague. Examples are given of properly structured class diagrams for a video rental system and other examples to illustrate class relationships like generalization, aggregation, and association.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

CSE 470 – Class Diagram Design

BRAC University
Guidelines
for Analyzing Requirements / Use Cases
 A common or improper noun implies a
class of objects
 A proper noun implies an instance of a
class
 A collective noun implies a class of
objects made up of groups of instances of
another class
Guidelines
for Analyzing Requirements / Use Cases (2)

 An adjective implies an attribute of an


object
 A doing verb implies an operation
 A being verb implies a relationship
between an object and its class
 A having verb implies an aggregation or
association relationship
Guidelines
for Analyzing Requirements / Use Cases (3)

 A transitive verb implies an operation


 An intransitive verb implies an exception
 A predicate or descriptive verb phrase
implies an operation
 An adverb implies an attribute of a
relationship or an operation
Class Diagram

 Ensurethat the classes are both necessary


and sufficient to solve the underlying
problem
 no missing attributes or methods in each class
 no extra or unused attributes or methods in
each class
 no missing or extra classes
Discarding Unnecessary and Incorrect
Classes

 Redundant Classes: Some potential classes


differ only in name.
 Irrelevant Classes: Classes that have
nothing to do with the system. Example:
computer connection
 Vague Classes: Classes whose meaning is
not clear at all. Examples: system and
software
Discarding Unnecessary and Incorrect
Classes

 Attributes: Some nouns in the list above are likely to be


modeled as attributes rather as classes. Examples:
author, title
 Operations: Some nouns are likely to be operations
rather than classes. Example: book search.
 Roles: Some nouns are roles of objects involved in
associations rather than classes.
 Implementation Constructs: Anything that is not part of
the real-world problem.
Types of Classes
 Ones found during analysis:
 people, places, events, and things about which
the system will capture information
 ones found in application domain
 Ones found during design
 specific
objects like windows and forms that
are used to build the system
Example of a Class Diagram
Video Rental System
visibility multiplicity class name

Customer 1..* 1..*


Video
-CID: int -cassetteID : int
-name: String rents -cassetteVolumeNo: int
+rentMovie()
+authenticateCustomer ()

attributes relationship methods


Class diagram example 1
Multiplicity

Customer Simple
1
Class Aggregation

Abstract Rental Invoice


Class

Rental Item 1..*


1 0..1

Composition Simple
Generalization Association

Checkout Screen
DVD Movie VHS Movie Video Game

10
Class diagram example 2

11
Class Diagram Example 3

Slide 12

You might also like