OOAD Short Note
OOAD Short Note
– Reusable components
A Software Development Methodology is a framework used to structure, plan, and control the software
development process
2. Systems design
3. Development
6. Maintenance
Structured Analysis and Design Technique (SADT) is a software engineering methodology for describing
systems as a hierarchy of functions.
SADT includes
OOAD includes
Technical approach for analyzing and designing software applying the object-orientated concepts and
visual modeling throughout the development life cycles to better stakeholder communication and
product quality
Advantages of OOAD
• Simplicity
• Modifiability
• Maintainability
OOAD Concepts
• Class
• Object
• Encapsulation
• Abstraction
• Inheritance
• Polymorphism
• Message passing
• Dynamic binding
Constructors
Constructors are special member functions of any class, which are invoked at the moment an instances
of the class are created. They are special functions that have the same name as their class.
Constructors
Circle::
Circle()
{
• Parameterized Constructor
Circle::Circle(int r)
{
radius = r;
Destructors
}
• Special member function
• No arguments
• No return value
• Cannot be overloaded
Pointers
Memory location which hold the address of another memory location/ variable
Access Specifies
• Public - members declared as Public are accessible from outside the Class through an object of
the class.
• Protected - members declared as Protected are accessible from outside the class BUT only in a
class derived from it.
Encapsulation
Advantages
Easy maintenance
Abstraction
Advantages
Abstraction
Ex-:
Inheritance
Forming a new class from an existing class as new class receive the old class information
Advantages
Code reusability
Provide specialization
Extendibility
Polymorphism
Method Overloading
2.Method Overriding
Overloading
• Ability to create multiple methods of the same name with different implementations.
Method Overriding
• Same name with the same parameters but can not be done be with in one class.
Allows a subclass or child class to provide a specific implementation of a method that is already provided
by one of its super classes or parent classes
Operator Overloading
• User Define Data Type (create a class after we can create a variable as class name
• The mechanism of giving such special meaning to an operator is called operator overloading.
• Used (+),(-) operator to special thin user difine data type as with - Varible_Name
3)Sizeof
4)conditional operator(?,:)
5)Assigment (=)
6)Funtion ()
Virtual Functions
• No Function body
Benefits of OOP
• Class diagram
• Package diagram
• Object diagram
• Component diagram
• Deployment diagram
Behavioral UML
• Activity diagram
• Sequence diagram
• State diagram
Actor
Inheritance
Actor
– The Actor is shown sending and receiving messages to and from the System
– e.g. Bank
Actor Variations
– Primary
– Secondary Actor
• The Actor who derives indirect benefits from or uses the system
• Actor based
– Specify the actors which will use the system and which other systems must interact with
it.
• Event based
– Identify the external events that a system must respond to Relate the events to actors
and use cases
Relationships
• Association
• Extend
• Include
• Depends on
Generalization
Associations
– Drawn between actors and use cases to show that an actor carries out a use case
<<Extend >>
<<Include>>
– Include relationship is modelled between the use cases when a use case includes the
behavior sequence of another use case.
<<Depends on>>
– Indicating that one use case cannot be performed until another use case has been
performed
Generalization
• the child use case contains the refined features. Relation between use cases
Scenario
Scenario consists of
Normal flow
Alternate flow
Sub flows
Exceptions
Normal Flow
The basic flow cover events what "normally" happens when the use case is performed.
Sub Flow
Alternate Flow
Exceptions
Exceptional flow elaborate failures which not achieving the use case's goal
– Actors
– Use Cases
– Diagram
– Use‐case Narratives
• A class diagram
– Represents a view of the class structure of a system in the logical view of a system
• Classes
– During analysis
• to indicate the common roles and responsibilities of the entities that provide
the system’s behavior
– During design
to capture the structure of the classes that form the system’s architecture
Class
Collection of group of things that have the same attributes and the same behaviors
Class Diagram
• Class diagram describes the types of objects in the system and the various kinds of static
relationships that exist among them.
• It also shows the attributes and services of a class and the constraints that apply to the way
objects are connected.
– Three compartments
• Class name
• Attributes
• Operations
– General Notation:
Major Components
• Name
– No spaces
• List of attributes
– No space
• List of methods
– No space
• Function signature
– acceptCloths(c:String):int
Visibility
• + Public
• ‐ Private
• # Protected
• ~ Package
Boundary Classes
Entity Classes
Control Classes
Relationships
• Association
• Aggregation/Composition
• Generalization/Inheritance
• Dependency
Associations
Multiplicity
1 Exactly one
Aggregation
Composition(Not-Shared Association)
Inheritance
Generalization/ Specialization
• Generalization
– Create super class encapsulate structure and behavior common to number of classes
• Specialization
Object Diagram
Object diagram is an instance of a class diagram; it shows a snapshot of the detailed state of a system at
a point in time
Component Diagrams
Component diagrams are used in modeling the physical aspects of object-oriented systems in
representation of the dependencies and interactions between software components, for visualizing,
specifying, and documenting components
Ports
Provided interface
Subsystem
❖ The object goes from multiple states depending upon the event that occurs within the object.
❖ The primary purpose of a state chart diagram is to model interactive systems and define each
and every state of an object.
❖ State chart diagrams are designed to capture the dynamic behavior of an application system.
These diagrams are used to represent various states of a system and entities within the system
Initial state
The initial state symbol is used to indicate the beginning of a state machine diagram.
Final state
Decision box
It contains a condition. Depending upon the result of an evaluated guard condition, a new path
is taken for program execution.
Transition
A transition is a change in one state into another state which is occurred because of some event.
A transition causes a change in the state of an object.
Characteristics of a state
❖ One can either place the name of a state within the rectangle or outside the rectangle in a
tabular box.
❖ When a state is in the working mode, it is active, as soon as it stops executing and transits into
another state, the previous state becomes inactive, and the current state becomes active.
Types of State
Simple state
Composite state
◦ These types of states can have one or more than one sub state.
◦ A composite state with two or more sub states is called an orthogonal state.
Submachine state
Examples
There are a total of two states, and the first state indicates that the OTP has to be entered first.
After that, OTP is checked in the decision box, if it is correct, then only state transition will occur,
and the user will be validated.
If OTP is incorrect, then the transition will not take place, and it will again go back to the
beginning state until the user enters the correct OTP as shown in the above state machine
diagram example.
Activity Diagram
Sequence Diagrams
A sequence diagram is representation of object interactions arranged in time sequence . It depicts the
objects and classes involved in the scenario and the sequence of messages exchanged between the
objects
Message
Messages types
• Synchronous message
– A synchronous message is used when the sender waits for the receiver to process the
message and return before carrying on with another message.
• Asynchronous message
– A synchronous message is used when the message caller does not wait for the receiver
to process the message and return before sending other messages to other objects.
• Return message
– A return message is used to indicate that the message receiver is done processing the
message and is returning control over to the message caller.
Activation Bar
– Activation bar or focus of control is the box placed on the lifeline. It is used to indicate
that an object is active (or instantiated) during an interaction between two objects. The
length of the rectangle indicates the duration of the objects staying active.
– Drawn when object method is on method stack waiting for other objects to finish,
Creation message
Destruction/Deletion
Reflexive message
• Fragment/Frame
– It is used to show complex interactions such as alternative flows and loops in a more
structured way
– Fragment operator
Stereotypes
Subscribe Us on Youtube
www.youtube.com/@nsjonlineacademy
Video 01
https://www.youtube.com/watch?v=TKesbyZHWog&list=PLXVeQCT5AgYtGYFVbZyNSL5_MtRm6n7Qz&i
ndex=1
Video 02
https://www.youtube.com/watch?v=GJqxETeOxzQ&list=PLXVeQCT5AgYtGYFVbZyNSL5_MtRm6n7Qz&in
dex=2
Rapid Revision 01
https://www.youtube.com/watch?v=0nnjefTC_Zc&list=PLXVeQCT5AgYtGYFVbZyNSL5_MtRm6n7Qz&ind
ex=4
Rapid Revision 02
https://www.youtube.com/watch?v=e47YnhN8EKM&list=PLXVeQCT5AgYtGYFVbZyNSL5_MtRm6n7Qz&i
ndex=5