Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 19

WHY OBJECT ORIENTED ANALYSIS AND DESIGN IS

USEFUL ?

BY SHAKEEL RAJA
HOUSE KEEPING FOR MS-TEAMS

 Lets be interactive
 Use the raise hand feature in teams
 Do not wait till the end of session for questions
 Bring in your own experience
 Use chat window for simple Yes/No answers
 Let’s hope this won’t last for too long 
CONTENTS

 Comparison of programming paradigms


 Object Oriented Paradigm
 Object Oriented Analysis and Design
 Rationale for using OOAD
 QnA
PROGRAMMING PARADIGMS

 Paradigm (Greek) : A Pattern / model / blueprint etc.


 Programming Paradigms identify principles, ideas, design concepts used to set up and organize the structure
of the program code.
 Any given coding problem can be solved in a multitude of ways and languages.
 A computer program can be developed using different programming languages that may follow different
programming paradigms.
 Programmers evaluate different paradigms and languages to select the best option.
 Single vs. multiparadigm languages.
SOME PROGRAMMING PRINCIPLES

 KISS (Keep it Simple Stupid)


 DRY (Do not repeat yourself)
 Open to extensions but closed to modifications
 Composition over inheritance
 Single Repository
 Separation of concerns
 YAGNI (You aren’t going to need it again)
 Documentation
 Refactoring
 Clean code (PEP 8 for Python) etc.
IMPERATIVE VS DECLARATIVE PARADIGMS
Imperative Paradigm
• Clearly defined sequence of instructions specifying what to do, how
to do it and when to do it.
• Variables are updated at runtime through control structures.
• Specific and system oriented .
• Assembler, Fortran, BASIC, COBOL, Java, C, C++, Python, Ruby
etc.

Declarative Paradigm
• Defines what needs to be done, rather than how to do it - using a
“Domain Specific Language”, with a focus on expected results.
• DSL hides the lower level control structures from user.
• Focus on logic and constraints to define the setup and outcome.
• SQL, RegEx, logic (Prolog), Python*, Miranda, JS.
OBJECT ORIENTED (OO) PARADIGM
 Object Orientation is a concept supported by most modern programming
languages – oriented/focused around Objects ( “a tangible, material things”)
 A Large problem is broken down into inter-connected objects (mini-programs)
having their own data and logic, representing different parts of the application.
E.g. employee, account, purchase order, product/service.
 Real World objects have two characteristics: State and Behaviour, identified as
fields/attributes and methods respectively.

A Bicycle Object
OBJECT ORIENTED (OO) MODELLING
 Class is a user defined pattern (consists of
declaration and definition for state and
behaviour) that provides a blueprint for objects.
 Object is an instance of a class .

Class car:
# a simple class for cars
# Constructor to initialize attributes
def __init__ (color, company, model, fuel):
self.color = color # Creating a car object
self.company = company car1 = car(‘green’, ‘Ford’,
self.model = model ‘Mustang’, ‘Gasoline’)
self.fuel = fuel
# calling the display method
# method to print car info car1.display()
def display (self):
print (‘This is a’, self.color, self.company, OUT: This is a green Ford Mustang
self.model, ‘running on’, self.fuel) running on Gasoline
OBJECT ORIENTED ANALYSIS AND DESIGN (OOAD)

 A structured method for analysing and designing a software


using Object Oriented approaches.
 Analysis: to create a model of the system regardless of
underlying constraints such as technology infrastructure.
Involves an abstract definition and functional
requirements for the most important objects.
 Design: to refine the analysis model and applies the needed
technology and other implementation constrains. Focuses on
describing the objects in detail, their attributes, behavior,
and mutual interactions.
OBJECT ORIENTED ANALYSIS

 The core activities in OOA are:


 Find the objects in the environment
 Organize the objects by creating class/object model (OMT)
 Explain how the objects communicates with each others
 Set the characteristic or behavior of the objects
 Set the internal of the objects
OBJECT ORIENTED DESIGN
 During OOD, the system is viewed as a collection of objects.
 The design is distributed among the objects, and each object
handles its state data.
 Objects communicate by message passing
 Abstraction “shows” only essential attributes and “hides”
unnecessary information.
 Encapsulation describes the idea of bundling attributes and
methods that work on that data within one unit, e.g., a class in
Java. 
 OOD allows similar classes to stack up in a hierarchy where the
lower or sub-classes can import, implement, and re-use allowed
variables and functions from their immediate super-classes.
 OOD languages provide a mechanism where methods performing
similar tasks but vary in arguments, can be assigned the same
name. This is known as polymorphism, which allows a single
interface is performing functions for different implementations. 
OOAD: OBJECT MODELING TECHNIQUE (OMT)

 Object modeling techniques is an methodology of object oriented analysis, design and implementation that focuses
on creating a model of objects from the real world and then to use this model to develop object–oriented software.
 Analysis: Model the real world with important properties and domain.
 Object Model shows the skeleton of the real world system and divides the whole application into objects (artifacts)
 Dynamic model represents the interaction between artifacts as events, states and transitions.
 Functional model represents the methods of the system from the data flow perspective. 

 System Design determines the overall system architecture using subsystems, concurrent tasks and data storage.
 The system is organized in to sub-systems which are then allocated to processes and tasks, taking into account concurrency and
collaboration.
 Persistent data storage is established along with a strategy to manage shared or global information.
 Boundary situations are checked to help guide trade off priorities.
OBJECT MODELING TECHNIQUE (OMT)

 Object Deign is concerned with fully classifying the existing classes, associations, attributes and
operations necessary for implementing a solution to the problem.
 Operations and data structures are fully defined along with any internal objects needed for implementation.
 Class level associations are determined.
 Issues of inheritance, aggregation, association and default values are checked.
UNIFIED MODELLING LANGUAGE (UML)

 The Unified Modeling Language (UML) is a graphical language for OOAD that gives a standard way to write a software system’s
blueprint.
 UML consists of an integrated set of diagrams to help system and software developers for specifying, visualizing, constructing, and
documenting the artifacts of software systems

Behavioral UML Diagram Structural UML Diagram


Activity Diagram Class Diagram
Use Case Diagram Object Diagram
Interaction Overview Diagram Component Diagram
Timing Diagram Composite Structure Diagram
State Machine Diagram Deployment Diagram
Communication Diagram Package Diagram
Sequence Diagram Profile Diagram
RATIONALE FOR OOAD

 Code Re-usability: A single class can instantiate any number of objects.


 Data Redundancy: Allows writing common class definitions for similar functionalities and inherit them.
 Code Maintenance: OOAD allows maintenance and modification of existing code in a systematic manner.
 Security: Using abstraction and data hiding, data exposure can be limited.
 Design Benefits: An extensive design phase allows fewer flaws and robust design.
 Productivity: More work done, better code, inbuilt features and easier code maintenance.
 Troubleshooting: With encapsulation in self contained objects, errors are much easier to spot and fix.
 Flexibility: Polymorphism allows an object to display different behaviors in different contexts.
LIMITATIONS OF OO PARADIGM.

 Steep learning curve: OOAD may not seem logical to programmers from procedural paradigm.
 Larger program size: May involve more lines of code than procedural languages
 Slower Programs: Require more instructions to be executed
 Suitability: Some problems maybe better suited for procedural, logical or functional paradigms.

You might also like