Refining Class Diagrams
Generalization/Specialisation
• Domain classes – class of things (objects) in the real world that a system needs to know about and
keep track of (information to store)
Domain Class Diagram
o Depicts the “noteworthy abstractions” in the application domain • Captures what the classes
“know”(information to be stored - attributes) and their relationships (rules around
associations - multiplicities)
o Important that the diagram is easy for users to understand (representational gap) – concepts
rather than classes
Analysis Class Diagram
o Move from modelling concepts to modelling software
o Depicts the important software classes in the user domain and how they will support the
user requirements
o Still a view of only the business (entity) classes
,Relationships:
- We classify things in terms of similarities and differences
- We use generalisation to group similar things
- We use specialisation to group different kinds of things
A Generalisation/specialisation relationship is used to rank or structure things from the more general
to the more specific – this forms a hierarchy
Superclass: Superior or more general class in the generalisation/specialisation relationship
Subclass: Subordinate or more specialised class the generalisation/specialisation relationship
, INHERITANCE
- Concept where specialisation classes inherit all the characteristics of the generalisation class
Inheritance makes it easier to create and maintain new specialised classes when they are needed
We use it when:
o Two or more classes share the same attributes and/or methods
o May differ in some aspects:
- In behaviour
- In data (attributes)
- In associations with other classes
the representation of an
“is a”,
“is like” or
“is a kind of” or
“is a type of”
Classes:
Abstract class: Class that ONLY exists to subclasses can inherit from it
Concrete Class: Class that does have objects instantiated from them
, ASSOCIATIONS:
Where there is a MANY-TO-MANY association between two classes and each association n instance
has its own attributes
Example:
Capturing information about illness and symptoms. An illness (e.g. flu) can be associated with many
symptoms (e.g. sore throat, fever), and a symptom (e.g. sore throat) can be associated with many
illnesses (e.g. flu, strep throat, common cold)
Band Example:
Generalization/Specialisation
• Domain classes – class of things (objects) in the real world that a system needs to know about and
keep track of (information to store)
Domain Class Diagram
o Depicts the “noteworthy abstractions” in the application domain • Captures what the classes
“know”(information to be stored - attributes) and their relationships (rules around
associations - multiplicities)
o Important that the diagram is easy for users to understand (representational gap) – concepts
rather than classes
Analysis Class Diagram
o Move from modelling concepts to modelling software
o Depicts the important software classes in the user domain and how they will support the
user requirements
o Still a view of only the business (entity) classes
,Relationships:
- We classify things in terms of similarities and differences
- We use generalisation to group similar things
- We use specialisation to group different kinds of things
A Generalisation/specialisation relationship is used to rank or structure things from the more general
to the more specific – this forms a hierarchy
Superclass: Superior or more general class in the generalisation/specialisation relationship
Subclass: Subordinate or more specialised class the generalisation/specialisation relationship
, INHERITANCE
- Concept where specialisation classes inherit all the characteristics of the generalisation class
Inheritance makes it easier to create and maintain new specialised classes when they are needed
We use it when:
o Two or more classes share the same attributes and/or methods
o May differ in some aspects:
- In behaviour
- In data (attributes)
- In associations with other classes
the representation of an
“is a”,
“is like” or
“is a kind of” or
“is a type of”
Classes:
Abstract class: Class that ONLY exists to subclasses can inherit from it
Concrete Class: Class that does have objects instantiated from them
, ASSOCIATIONS:
Where there is a MANY-TO-MANY association between two classes and each association n instance
has its own attributes
Example:
Capturing information about illness and symptoms. An illness (e.g. flu) can be associated with many
symptoms (e.g. sore throat, fever), and a symptom (e.g. sore throat) can be associated with many
illnesses (e.g. flu, strep throat, common cold)
Band Example: