Unit 7 Object-Oriented Analysis and Design
Unit 7 Object-Oriented Analysis and Design
Object-Oriented Design (OOD): In this phase, the object-oriented model developed in the OOA
phase is refined and translated into a blueprint for the system. This includes defining the classes,
their attributes, methods, and relationships. This is typically done through techniques such as
class diagramming and inheritance.
Object-Oriented Programming (OOP): In this phase, the design from the OOD phase is
implemented using an object-oriented programming language such as Java, C++, or Python. This
involves writing code for the classes, attributes, and methods defined in the design.
BCA III: PU Compiled By: GIRIJA 2
Testing and Integration: In this phase, the individual components of the system are tested and
integrated to ensure that they work together correctly. This includes unit testing, integration
testing, and system testing.
Deployment and Maintenance: In this phase, the system is deployed to the production
environment and maintained over time. This includes fixing bugs, adding new features, and
making other changes as needed.
Complexity: The OO-LC Model can be more complex to learn and understand than other
software development methodologies.
Upfront time: It may take more time upfront to design and implement an object-oriented
system compared to other approaches.
Not suitable for all projects: The OO-LC Model is not suitable for all types of projects, such
as those that are very small or simple.
BCA III: PU Compiled By: GIRIJA 3
Designers
Coders
Testers
BCA III: PU Compiled By: GIRIJA 4
QA
The Customer
Technical Authors
All of these people are interested in different aspects of the system, and each of them require a
different level of detail. For example, a coder needs to understand the design of the system and
be able to convert the design to a low level code. By contrast, a technical writer is interested in
the behavior of the system as a whole, and needs to understand how the product functions. The
UML attempts to provide a language so expressive that all stakeholders can benefit from at least
one UML diagram.
Here's a quick look at each one of these 13 diagrams in as shown in the UML 2 Diagram Structure
below:
Structure diagrams show the static structure of the system and its parts on different abstraction
and implementation levels and how they are related to each other. The elements in a structure
diagram represent the meaningful concepts of a system, and may include abstract, real world
and implementation concepts, there are seven types of structure diagram as follows:
Class Diagram
Component Diagram
Deployment Diagram
Object Diagram
Package Diagram
Composite Structure Diagram
Profile Diagram
Behavior diagrams show the dynamic behavior of the objects in a system, which can be
described as a series of changes to the system over time, there are seven types of behavior
diagrams as follows:
Use Case Diagram
Activity Diagram
State Machine Diagram
Sequence Diagram
Communication Diagram
Interaction Overview Diagram
Timing Diagram
BCA III: PU Compiled By: GIRIJA 5
Know all these all types of diagram how it works on one system (Assume One System).
C. Use-Case Modeling
The Use-case modeling is defined as a model which is used to show how users interact with the
system in order to solve a problem. As such, the use case model defines the user's objective, the
interactions between the system and the user, and the system's behavior required to meet these
objectives.
Various model elements/components are contained in use-case model which are:
Actors: Represent any entity that interacts with the system, such as users, external
systems, or devices.
Use Cases: Describe a sequence of actions between an actor and the system to achieve a
specific goal. Each use case represents a complete unit of functionality.
BCA III: PU Compiled By: GIRIJA 6
Relationships: Define how actors and use cases interact. These can be inclusions (one use
case includes another), extensions (a use case adds functionality to another), or
generalizations (a more specific use case inherits from a more general one).
We use a use-case diagram to graphically portray a subset of the model in order to make the
communication simpler. There will regularly be a numerous use-case diagram which is related to
the given model, each demonstrating a subset of the model components related to a specific
purpose.
Subject
Use-Case Package
Generalizations
Dependencies
Subject
The subject component is used to represent the boundary of the system of interest.
Use-Case Package
We use the model component in order to structure the use case model to make simpler the
analysis, planning, navigation, and communication. Suppose there are various actors or use cases.
In that case, we can also use use-case packages in order to further structure the use-case model
in much the similar way we use directories or folders to organize the information on our hard-
disk.
For various reasons, we divide the use-case model into the use-case packages, containing:
To help parallel development by partitioning the problem into bite-sized parts.
To improve communication with various stakeholders by making packaging containing
actors, use cases and related to the specific stakeholder.
Generalizations
Generalizations mean the association between the actors in order to help re-use of common
properties.
Dependencies
In UML, various types of dependencies are defined between use cases. In particular,
<<include>> and <<extend>>.
BCA III: PU Compiled By: GIRIJA 7
We use <<include>> dependency to comprise shared behavior from an included use case into a
base use case to use common behavior.
We use <<extend>> dependency to include optional behavior from an extended use-case into
an extended use case.
Importance of Use-Case Diagram
Use Cases have been broadly used over the last few years. There are various benefits of the use-
case diagram:
Use-case diagram provides an outline related to all components in the system. Use-case
diagram helps to define the role of administrators, users, etc.
The use-Case diagram helps to provide solutions and answers to various questions that
may pop up if you begin a project unplanned.
It helps us to define the needs of the users extensively and explore how it will work.
Use-Case
With the help of the Ovals, we can draw the use-cases. With the verb we have to label the ovals
in order to represent the functions of the system.
Actors
Actors mean the system's users. If one system is the actor of the other system, then with the
actor stereotype, we have to tag the actor system.
BCA III: PU Compiled By: GIRIJA 8
Relationships
With the simple line we can represent relationships between an actor and use cases. For
relationships between use-case, we use arrows which are labeled either "extends" or "uses".
The "extends" relationship shows the alternative options under the specific use case. The "uses"
relationship shows that single use-case is required to accomplish a job.
Example: Use Case Diagram for Customer Relationship Management of Internet Service
Provider.
the first partition contains a Class name which is the name of the class or entity which is
participated in the activity,
the Second partition contains class attributes that show the various properties of the
class,
the third partition contains class operations which shows various operations performed
by the class, relationships shows the relation between two classes.
1. Class Name:
The name of the class is typically written in the top compartment of the class box and
is centered and bold.
2. Attributes:
Attributes, also known as properties or fields, represent the data members of the
class. They are listed in the second compartment of the class box and often include the
visibility (e.g., public, private) and the data type of each attribute.
BCA III: PU Compiled By: GIRIJA 12
3. Methods:
Methods, also known as functions or operations, represent the behavior or
functionality of the class. They are listed in the third compartment of the class box and
include the visibility (e.g., public, private), return type, and parameters of each
method.
4. Visibility Notation:
Visibility notations indicate the access level of attributes and methods. Common
visibility notations include:
+ for public (visible to all classes)
- for private (visible only within the class)
# for protected (visible to subclasses)
~ for package or default visibility (visible to classes in the same package)
Parameter Directionality
In class diagrams, parameter directionality refers to the indication of the flow of information
between classes through method parameters. It helps to specify whether a parameter is an
input, an output, or both. This information is crucial for understanding how data is passed
between objects during method calls.
There are three main parameter directionality notations used in class diagrams:
In (Input):
An input parameter is a parameter passed from the calling object (client) to the
called object (server) during a method invocation.
It is represented by an arrow pointing towards the receiving class (the class
that owns the method).
Out (Output):
An output parameter is a parameter passed from the called object (server)
back to the calling object (client) after the method execution.
It is represented by an arrow pointing away from the receiving class.
BCA III: PU Compiled By: GIRIJA 13
Association
Association is a broad term that encompasses just about any logical connection or relationship
between classes. For example, passengers and airline may be linked as above.
BCA III: PU Compiled By: GIRIJA 14
Directed Association
Reflexive Association
This occurs when a class may have multiple functions or responsibilities. For example, a staff
member working in an airport may be a pilot, aviation engineer, ticket dispatcher, guard, or
maintenance crew member. If the maintenance crew member is managed by the aviation
engineer there could be a managed by relationship in two instances of the same class.
BCA III: PU Compiled By: GIRIJA 15
Multiplicity
Multiplicity is the active logical association when the cardinality of a class in relation to another
is being depicted. For example, one fleet may include multiple airplanes, while one commercial
airplane may contain zero to many passengers. The notation 0..* in the diagram means “zero to
many”.
Aggregation
Aggregation refers to the formation of a particular class as a result of one class being aggregated
or built as a collection. For example, the class “library” is made up of one or more books, among
other materials. In aggregation, the contained classes are not strongly dependent on the lifecycle
of the container. To show aggregation in a diagram, draw a line from the parent class to the child
class with a diamond shape near the parent class.
BCA III: PU Compiled By: GIRIJA 16
Composition
The composition relationship is very similar to the aggregation relationship. with the only
difference being its key purpose of emphasizing the dependence of the contained class to the life
cycle of the container class. That is, the contained class will be obliterated when the container
class is destroyed. For example, a shoulder bag’s side pocket will also cease to exist once the
shoulder bag is destroyed.
To show a composition relationship in a UML diagram, use a directional line connecting the two
classes, with a filled diamond shape adjacent to the container class and the directional arrow to
the contained class.
Inheritance/Generalization
Realization
Realization denotes the implementation of the functionality defined in one class by another
class. To show the relationship in UML, a broken line with an unfilled solid arrowhead is drawn
from the class that defines the functionality of the class that implements the function. In the
example, the printing preferences that are set using the printer setup interface are being
implemented by the printer.
7. Label Relationships:
Label the relationships with multiplicity and role names if needed. Multiplicity
indicates the number of instances involved in the relationship, and role names clarify
the role of each class in the relationship.
8. Review and Refine:
Review your class diagram to ensure it accurately represents the system’s structure
and relationships. Refine the diagram as needed based on feedback and requirements.
9. Use Tools for Digital Drawing:
While you can draw class diagrams on paper, using digital tools can provide more
flexibility and ease of modification. UML modeling tools, drawing software, or even
specialized diagramming tools can be helpful.
Using standard Unified Modeling Language (UML) notation, a state diagram somewhat resembles
an operational flowchart that outlines the various state-altering processes that occur within a
system.
Initial state
We use a black filled circle represent the initial state of a System or a Class.
BCA III: PU Compiled By: GIRIJA 21
Transition
We use a solid arrow to represent the transition or change of control from one state to another.
The arrow is labelled with the event which causes the change in state.
State
We use a rounded rectangle to represent a state. A state represents the conditions or
circumstances of an object of a class at an instant of time.
BCA III: PU Compiled By: GIRIJA 22
Fork
We use a rounded solid rectangular bar to represent a Fork notation with incoming arrow from
the parent state and outgoing arrows towards the newly created states. We use the fork
notation to represent a state splitting into two or more concurrent states.
Join
We use a rounded solid rectangular bar to represent a Join notation with incoming arrows from
the joining states and outgoing arrow towards the common goal state. We use the join notation
when two or more states concurrently converge into one on the occurrence of an event or
events.
BCA III: PU Compiled By: GIRIJA 23
Self-transition
We use a solid arrow pointing back to the state itself to represent a self transition. There might
be scenarios when the state of the object does not change upon the occurrence of an event.
We use self transitions to represent such cases.
Composite state
We use a rounded rectangle to represent a composite state also. We represent a state with
internal activities using a composite state.
BCA III: PU Compiled By: GIRIJA 24
Final State
We use a filled circle within a circle notation to represent the final state in a state machine
diagram.
Below are the steps of how to draw the State Machine Diagram in UML:
Step1. Identify the System:
Understand what your diagram is representing.
Whether it’s a machine, a process, or any object, know what different situations or
conditions it might go through.
BCA III: PU Compiled By: GIRIJA 25
Let’s understand State diagram with the help of an example, ie. MIS for College :
Asynchronous
Represented by a dashed line with a
return message
lined arrowhead.
symbol
Deployment Diagram:
Component Diagram: