Module5 - Object Oriented Analysis Static Model
Module5 - Object Oriented Analysis Static Model
Module5 - Object Oriented Analysis Static Model
Software Engineering
Computer Science
Academic Year 2023/2024
1
Contents
1. Introduction
• What will we learn
2. Domain Model
3. Class Diagrams
- Classes
- Attributes
- Operations
- Class Relationships
4. Object Diagrams
- Associations
- Constraints
1. Introduction
What will we learn?
• Static or Structural modeling captures the static features of a system.
• Structural model represents the framework for the system and this framework is the place
where all other components exist. Hence, the class diagram, component diagram and
deployment diagrams are part of structural modeling. They all represent the elements and
the mechanism to assemble them.
• The structural model does not describes the dynamic behavior of the system.
• What are we going to see in this section? Modeling Elements in UML! Such as:
Classes diagrams
Objects diagrams
1. Introduction
What will we learn?
• The static model: aspects of the internal structure of the system.
Intra-object: attributes and operations of clases.
Inter-object: relations between object clases.
• OOA/D uses the Analysis done in UML use cases and diagrams to help developers
understand the requirements and to design software. OOAD uses UML diagrams to
represent the different components and interactions of a software system.
1. Introduction
What will we learn?
1. Introduction
What will we learn?
1. Introduction
What will we learn?
OOA/D
Examples
Discovering Static Model
Objects
OOA/D
Object
Domain Model
Diagrams
Class
Diagrams
1. Introduction
• Book References
• During analysis, we use class diagrams to indicate the common roles and
responsibilities of the entities that provide the system’s behavior. During design, we
will use class those diagrams to capture the structure of the classes that form the
system’s architecture.
• The two essential elements of a class diagram are classes and their basic
relationships.
3. Class Diagrams
• A class is a detailed description
of what a thing (an object) will
be.
• It’s basically the template for
the future objects that we will
created.
• The figure shows the icon used to represent a
• Describes the data (attributes or
class in UML and in a class diagram and an
state) and operations (the
example from a “Gardening System”. The class
behavior) that will be shared by
icon consists of three compartments, with the
all instances (objects) of the
first occupied by the class name, the second
class.
by the attributes, and the third by the
• Many objects can be created operations.
from a class.
3. Class Diagrams
Class and Objects in UML
3. Class Diagrams
Classes in UML
• A name is required for each class and must be unique to its enclosing namespace.
By convention, the name begins in capital letters, and the space between multiple
words is omitted.
• Again by convention, the first letter of the attribute and operation names is
lowercase, with subsequent words starting in uppercase, and spaces are omitted
just as in the class name. Since the class is the namespace for its attributes and
operations, an attribute name must be unambiguous in the context of the class. So
must an operation name, according to the rules in the chosen implementation
language.
3. Class Diagrams
Classes in UML
• The format of the attribute and operation specifications of a class is shown here:
Attribute specification format
• Attributes are shared characteristics of all objects created from the same class.
• For each object attributes we get to assign a value.
• Each attribute has a type (the ones found in any programming language (int, boolean…).
• Note from the example figure that in the TemperatureSensor class, the multiplicity of [0..60] on the
measuredTemperature attribute indicates an array of 0 to 60 temperature measurements.
• The default value for an attribute is the value to be given at creation time, if none was provided.
• The property string listed in braces provides additional properties such as {list} shown after the
measuredTemperature attribute. In this case, the keyword list means that the temperature
measurementswill be ordered and may be nonunique. This provides the means to see the tim
ordering of the measurements and to permit a repetition in measured temperature.
3. Class Diagrams
Operations
• A class’s operations describe what a class can do but not necessarily how it is going to do it. An
operation is more like a promise or a minimal contract that declares that a class will contain some
behavior that does what the operation says it will do. The collection of all the operations that a class
contains should totally encompass all of the behavior that the class contains.
• Operations are common to all object’s instances of a same class.
• The behaviour is applied on the object for which it is called (the one that executes the operation).
• They have a name, parameters, return type, exceptions and possibly a set of pre and post condition.
• Parameters are used to specify the information provided to an operation to allow it to complete its job.
More than one parameter can be passed to an operation by splitting the parameters with a comma.
• An operation’s signature also contains a return type. A return type is specified after a colon at the end.
3. Class Diagrams
Visibility
• Visibility notations indicate the
access level of attributes and
methods. Common visibility
notations include:
Stage 1 Stage 4
Stage 2 Stage 3
Identify the Apply
Identify the Identify
initial stage appropiate
intermediate conditions or
and the final notations and
activities constraints
stage symbols
2. Use Cases in UML
https://youtu.be/pCK6prSq8aw