SPM Class Diagram

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

SPM - Class Diagram

Course Co-ordinator : Dolly Das

School of Computer Science Engineering and Technology


Bennett University

Lecture 2 Dolly Das February 2, 2024 1 / 10


Outline

1 Sequence Diagram

2 Collaboration or Communication Diagram

3 UML Class Diagram

4 Class Visibility

5 Relationships between classes

6 Data Flow Diagrams

Lecture 2 Dolly Das February 2, 2024 2 / 10


Sequence Diagram
Commonly used interaction diagram
Also known as an event diagram
Interaction diagram
Interactive behavior of a system
Visualization is difficult ; therefore capture features and aspects of interaction
Depicts the interaction between objects in a sequential manner
Describes how objects function in a system and in what order
Documented to understand the requirement of business organizers and software
developers
.
Sequence Diagram Notation
Actors - represents a type of role where it interacts with the system and its objects.
An actor is always outside the scope of the system.
Lifelines - depicts an individual participant (instance of an object) in a sequence
diagram, and are located at the top in a sequence diagram. Instance Name : Class
Name
Messages- Communication between objects is depicted using messages and appear
sequentially on the lifeline
Messages are represented using arrows
Synchronous messages- waits for a reply before forwarding with an interaction
and is represented using a solid arrow head
Asynchronous Messages- moves forward irrespective of the receiver processing
the previous message or not. A lined arrow head is used to represent an
asynchronous message.
Lecture 2 Dolly Das February 2, 2024 3 / 10
Collaboration or Communication Diagram

Represents how objects interact to perform the behaviour of a particular use-case, and
hence are best suited for use-case analysis.
Defines the roles of the objects that perform a particular flow of events of a use-case
Determines class responsibilities and interfaces
Collection of named objects and actors with links connecting them and they collaborate in
performing the task.
Objects establish a meaningful relationship between themselves, and provides emergent
desirable and high-level functionalities in object oriented systems.
Capture interactions that show the messages passing between objects and roles within the
collaboration, and each message has a sequence number.
Objects
Objects are named and have their specified classes
Class can have many objects : Object name : Class name
Each actor has a name and a role- Only one actor will be the initiator
Link is an instance of association
Messages are communication established between objects

Lecture 2 Dolly Das February 2, 2024 4 / 10


UML Class Diagram
It is used to construct and visualize object oriented systems
A static structure diagram that displays
Classes
Attributes of classes
Methods or operations
Relationships amongst objects/classes
Class
A blueprint for an object
Used to create the objects and describe the type of objects
Objects are usable instances of classes that have states and behaviours
Class Notation
Encapsulates attributes and operations
Each attribute has a type and each operation has a signature
The name of the class appears in the 1st partition of the class
The class attributes appear in the second partition of the class , and its type is
shown after a colon
Attributes map into member variables/data members in Object Modeling
Class operations takes the 3rd partition of the class, and its return type is
implicated after the colon and at the end of the method signature
Return type of method parameters are represented after the colon following the
parameter name.

Lecture 2 Dolly Das February 2, 2024 5 / 10


Class Visibility

+, - and symbols before an attribute and operation name in a class denote the visibility
of the attribute and operation.
+ denotes public attributes or operations
- denotes private attributes or operations
denotes protected attributes or operations
Parameter Directionality
Each parameter in an operation (method) may be denoted as in, out or inout which
specifies its direction with respect to the caller.
Direction is shown before the parameter name.
Perspectives of Class Diagram
Analysis models feature a mix of conceptual and specification perspectives.
Design model development evolves from specification to implementation
Specification: focus is on the interfaces of Abstract Data Type (ADTs) in the
software
Implementation: Describes how classes will implement their interfaces
The perspective affects the amount of detail to be supplied and the kinds of
relationships worth presenting.

Lecture 2 Dolly Das February 2, 2024 6 / 10


Relationships between classes
Inheritance (or Generalization):
A generalization is a taxonomic relationship between a more general classifier and a
more specific classifier.
Each instance of the specific classifier is also an indirect instance of the general
classifier.
Specific classifier inherits the features of the more general classifier
Represents an ”is-a” relationship.
An abstract class name is shown in italics. SubClass1 and SubClass2 are
specializations of SuperClass.
SubClass1 and SubClass2 are derived from SuperClass.
The relationship is displayed as a solid line with a hollow arrowhead that points
from the child element to the parent element.
Association
Relationships between classes in a UML Class Diagram, represented by a solid line
between classes.
Typically named using a verb or verb phrase which reflects the real world problem
domain.
A structural link between two peer classes is called a simple association
The relationship is displayed as a solid line connecting the two classes.
Cardinality
one to one ; one to many ; many to many

Lecture 2 Dolly Das February 2, 2024 7 / 10


Relationships between classes

Aggregation
Aggregation represents a ”part of” relationship.
Class2 is part of Class1.
Many instances (*) of Class2 can be associated with Class1.
Objects of Class1 and Class2 have separate lifetimes.
Composition
A special type of aggregation where parts are destroyed when the whole is destroyed.
Objects of Class2 live and die with Class1.
Class2 cannot stand by itself.
Dependency
An object of one class might use an object of another class in the code of a method.
If the object is not stored in any field, then this is modeled as a dependency
relationship.
Exists between two classes if changes to the definition of one may cause changes to
the other (but not the other way around). Class1 depends on Class2
Realization
Relationship between the blueprint class and the object containing its respective
implementation level details.
This object is said to realize the blueprint class - the relationship between the
interface and the implementing class.

Lecture 2 Dolly Das February 2, 2024 8 / 10


Data Flow Diagrams
DFDs are employed as a preliminary step in system analysis and provides an initial
overview of the system without delving into excessive detail
Provides a comprehensive insight into the intricate web of information flows within a
system
A graphical tool, instrumental in illustrating how data navigates through the various
facets of an information system, encompassing processes, data storage, and the generation
of reports.
The strategic approach ensures that the essential components and interactions are
captured efficiently before diving into the granular aspects of system requirements.
DFDs are an invaluable asset in the arsenal of information technology professionals and
systems analysts.
Ability to visually represent complex data flows, facilitate systematic exploration, and
adapt to various system architectures.
Hierarchy and Decomposition
Key strength of DFD is its ability to decompose a system into manageable
subsystems.
Subsystems are further broken down into lower-level components, creating a
hierarchical structure.
Systematic exploration of the system, with each layer dedicated to a specific process
or data function.
The foundational level or Level 0 or the context level, provides an overarching view
of the entire system, while subsequent levels, such as Level 1 diagrams, delve into
the specifics of individual processes.
Lecture 2 Dolly Das February 2, 2024 9 / 10
Data Flow Diagrams

Visualization and Documentation


Utilizing data flow diagrams facilitates a visual understanding of how data moves
between different processes within a system.
Information technology professionals and systems analysts leverage DFDs as a
documentation tool to elucidate the intricacies of data flow to end-users.
The process often begins with an overarching view, allowing analysts to gradually
zoom into the finer details of each process.
Systematic Exploration
DFDs offer a systematic approach to exploring and understanding complex systems.
Analysts can initiate the exploration at a higher level, capturing the essence of the
entire system, before progressively zooming into the nuances of individual processes.
This methodical progression ensures that the system is comprehensively
documented while allowing for detailed elaboration where necessary.
Flexibility in Representation
Whether the system is manual, automated, or a combination of both, a
well-constructed DFD can adapt to various scenarios.
This flexibility makes DFDs a versatile tool suitable for a wide range of systems,
accommodating different levels of complexity.

Lecture 2 Dolly Das February 2, 2024 10 / 10

You might also like