Modelling With UML in Software Engineering
Modelling With UML in Software Engineering
Relationship Names
• Names of relationships are written in the middle of the association
line. They have a small arrowhead to show the direction in which
direction to read the relationship.
Good relation names make sense when you read them out loud:
"Every spreadsheet contains some number of cells",
"an expression evaluates to a value"
Visibility of Class attributes and Operations
• In object-oriented design, there is a notation of visibility for attributes and
operations.
• UML identifies four types of visibility: public, protected, private,
and package.The +, -, # 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
• ~ denotes package attributes or operations
Steps to construct a class diagram
• Step 1: Identify the class names
• Step 2: Distinguish relationships(determine how each of the classes or
objects are related to one another. )
• Step 3: Create the Structure(add the class names and link them with
the appropriate connectors. You can add attributes and functions/
methods/ operations later.)
Example class diagram showing Aggregation
Example class diagram showing Inheritance
Interaction diagrams
• Interaction diagram is used to describe the type of interactions among the different
elements in the model. This interaction is a part of dynamic behaviour of the system.
• This interactive behaviour is represented in UML by two diagrams :
1. Sequence diagram : emphasizes on time sequence of messages
2. Collaboration diagram: emphasizes on the structural organization of the objects that
send and receive messages.
• The basic purpose of both the diagrams are similar
• The purpose of interaction diagrams is to visualize the interactive behaviour of the
system,hence the solution is to use different types of models to capture the different
aspects of the interaction.
• Sequence and collaboration diagrams are used to capture the dynamic nature but from a
different angle.
• The purpose of interaction diagram is −
• To capture the dynamic behaviour of a system.
• To describe the message flow in the system.
• To describe the structural organization of the objects.
• To describe the interaction among objects.
• Following things are to be identified clearly before drawing the
interaction diagram
• Objects taking part in the interaction.
• Message flows among the objects.
• The sequence in which the messages are flowing.
• Object organization.
Notation of an interaction diagram
State chart diagrams
• Statechart diagram is used to model the dynamic nature of a system.
• They define different states of an object during its lifetime and these
states are changed by events.
• Statechart diagrams are useful to model the reactive systems.
Reactive systems can be defined as a system that responds to external
or internal events.
• It describes the flow of control from one state to another state.
States are defined as a condition in which an object exists and it
changes when some event is triggered.
Main purposes of using Statechart diagrams −
• To model the dynamic aspect of a system.
• To model the life time of a reactive system.
• To describe different states of an object during its life time.
• Define a state machine to model the states of an object.
Before drawing a Statechart diagram we should
• Identify the important objects to be analyzed.
• Identify the states.
• Identify the events.
Activity diagram
• Activity diagram is basically a flowchart to represent the flow from one
activity to another activity. The activity can be described as an operation of
the system.
• The control flow is drawn from one operation to another. This flow can be
sequential, branched, or concurrent.
• Abstraction simply means to hide the details to reduce complexity and increases efficiency or quality.
• Different levels of Abstraction are necessary and must be applied at each stage of the design process so
that any error that is present can be removed to increase the efficiency of the software solution and to
refine the software solution.
• The solution should be described in broadways that cover a wide range of different things at a higher
level of abstraction and a more detailed description of a solution of software should be given at the
lower level of abstraction.
• Two types of abstraction :procedural abstraction and data abstraction
• Examples:An example of a procedural abstraction would be the word open for a door. Open implies a
long sequence of procedural steps (e.g., walk to the door, reach out and grasp knob, turn knob and pull
door, step away from moving door, etc.)We can define a data abstraction called door. A set of attributes
that describe the door (e.g., door type, swing direction, opening mechanism, weight, dimensions).
2. Architecture- design a structure of something
• Separation of concerns is a design concept, that suggests any complex problem can be more
easily handled if it is subdivided into pieces that can each be solved and/or optimized
independently.
• By separating concerns into smaller, and therefore more manageable pieces, a problem takes
less effort and time to solve.
• Separation of concern is visible) in other related design concepts:
o Modularity,
o Aspects,
o Functional independence,
o Refinement.
4. Pattern- a repeated form
• The pattern simply means a repeated form or design in which the same shape is
repeated several times to form a pattern.
• The pattern in the design process means the repetition of a solution to a
common recurring problem within a certain context.
5. Modularity- subdivide the system
• Modularity simply means to divide the system or project into smaller parts to
reduce the complexity of the system or project.
• In the same way, modularity in design means to subdivide a system into smaller
parts so that these parts can be created independently and then use these parts
in different systems to perform different functions..
6.Information Hiding- hide the information
• Information hiding simply means to hide the information so that it cannot be accessed by an unwanted
party. In software design, information hiding is achieved by designing the modules in a manner that the
information gathered or contained in one module is hidden and it cant be accessed by any other
modules.
7.Functional independence-
• The functional independence is the concept of separation and related to the concept of modularity,
abstraction and information hiding. The functional independence is accessed using two criteria i.e
Cohesion and coupling.
1. Cohesion: Cohesion is an extension of the information hiding concept.
• A cohesive module performs a single task and it requires a small interaction with the other components
in other parts of the program.
2. Coupling:
• Coupling is an indication of interconnection between modules in a structure of software
8.Refinement- removes impurities
• Refinement simply means to refine something to remove any impurities if present and increase
the quality.
• The refinement concept of software design is actually a process of developing or presenting the
software or system in a detailed manner that means to elaborate a system or software.
• Refinement is very necessary to find out any error if present and then to reduce it.
9.Refactoring- reconstruct something
• Refactoring means to reconstruct something in such a way that it does not affect the behaviour or
any other features.
• Refactoring in software design means to reconstruct the design to reduce and complexity and
simplify it without affecting the behaviour or its functions.
• Fowler has defined refactoring as “the process of changing a software system in a way that it
won’t affect the behaviour of the design and improves the internal structure”.
10. Aspects:
• A representation of a cross-cutting concern that must be accommodated as
refinement and modularization occur.
• For example : (Module A cross cut Module B means B cannot be satisfied
without considering A).
11. Object-Oriented Design Concepts :
• The object-oriented (OO) paradigm is widely used in modern software
engineering.
• OO design concepts such as classes and objects, inheritance, messages, and
polymorphism, among others are the different features of oo paradigm.
12. Design Class
• Refine analysis classes by providing detail needed to implement the classes and
implement a software infrastructure the support the business solution
• Five types of design classes can be developed to support the design architecture..
1. User interface classes – abstractions needed for human-computer interaction (HCI)
2. Business domain classes – refinements of earlier analysis classes
3. Process classes – implement lower level business abstractions required to fully
manage the business domain classes.
4. Persistent classes – represents data stores that will persist beyond software
execution
5. System classes – implement software management and control functions…
Design model
• A design model in Software Engineering is an object-based picture or
pictures that represent the use cases for a system.
• Or t it means to describe a system's implementation and source code
in a diagrammatic fashion.
• This type of representation has two advantages.
1) it is a simpler representation than words alone.
2) people can look at these simple diagrams and quickly get the
general idea behind a system.
Elements of design model
• Data: The data design element produced a model of data which is
processed by the computer based system. The structure of data is the
most important part of the software design.
• Architectural - This involves breaking the system down into its major
functional pieces and describing each in a diagrammatic fashion. The
interaction between each piece is also described. For example, an
instant messaging system might have a 'send message' piece and an
interaction might be the user types characters that act as input to the
send message piece.
• Interface - The architectural interactions are broken down and described in
greater detail. For example, the user typed characters mentioned above might
be described as arriving a character at a time, each character is displayed on the
cell phone screen as it is typed.
• Component Level - The pieces described in the architectural item above are
broken down into lower level components. For example, the send message piece
might become 'receive character' component, 'display character' component,
and 'transmit character' component.
• Deployment Level - The components arrived at during the previous step are
grouped for the purpose of delivery to their final destination. For example, the
components of the 'send message' piece might be grouped together with other
pieces for deployment on a cell phone.
THANK YOU