0% found this document useful (0 votes)
8 views19 pages

Unit 3

The document provides an introduction to Object-Oriented Programming (OOP), covering key principles such as encapsulation, abstraction, inheritance, and polymorphism. It outlines the Object-Oriented System Development Methodology, including analysis, design, implementation, testing, and maintenance phases, while comparing traditional structured approaches with object-oriented approaches. Core concepts such as objects, classes, attributes, and methods are explained, along with examples to illustrate their application.

Uploaded by

todoheh805
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views19 pages

Unit 3

The document provides an introduction to Object-Oriented Programming (OOP), covering key principles such as encapsulation, abstraction, inheritance, and polymorphism. It outlines the Object-Oriented System Development Methodology, including analysis, design, implementation, testing, and maintenance phases, while comparing traditional structured approaches with object-oriented approaches. Core concepts such as objects, classes, attributes, and methods are explained, along with examples to illustrate their application.

Uploaded by

todoheh805
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Unit III

Introduction to Object Oriented Paradigm


Topics to be covered
• Introduction
• Object Oriented System Development Methodology
• Difference between Structured approach and OO approach
• Objects
• Classes
• Attributes
• Behavior and methods
Introduction
• Object-Oriented Programming (OOP):
• A programming paradigm based on the concept of "objects", which can contain data and
code.
• Data is in the form of fields (often known as attributes or properties), and code is in the
form of procedures (often known as methods).
• Key Principles: Encapsulation, Abstraction, Inheritance, and Polymorphism.
• History:
• Origins: The concept of OOP was introduced in the 1960s with the Simula language.
• Evolution: Became popular in the 1980s with languages like C++, and later with
Java and Python.
• Importance:
• Modularity: Code is organized into objects, making it easier to manage and
understand.
• Reusability: Objects and classes can be reused across different programs.
• Maintainability: Easier to update and maintain due to modularity.
• Flexibility: Systems can be extended with new object types without altering
existing code.
Object-Oriented System
Development Methodology
• Analysis:
• Requirements Gathering: Collecting and analysing requirements from
stakeholders.
• Object Identification: Identifying potential objects and their interactions.
• Use Case Modelling: Creating use cases to represent functional requirements.
• Design:
• System Architecture: Defining the overall system architecture.
• Class Design: Designing classes, their attributes, methods, and interactions.
• Object Collaboration: Modeling how objects collaborate to fulfill system
requirements.
• Implementation:
• Coding: Writing the actual code in an object-oriented language.
• Integration: Combining different modules and ensuring they work together.
• Testing:
• Unit Testing: Testing individual components or classes.
• Integration Testing: Testing interactions between integrated units.
• System Testing: Testing the entire system as a whole.
• Maintenance:
• Corrective Maintenance: Fixing bugs and issues.
• Adaptive Maintenance: Adapting the system to new requirements or
environments.
• Perfective Maintenance: Enhancing performance or adding new features.
Comparative Analysis
• Modularity:
• Traditional: Functions and data are separate; less modular.
• OO: Encapsulation leads to high modularity.
• Reusability:
• Traditional: Code reusability is limited.
• OO: Inheritance and polymorphism enhance reusability.
• Flexibility:
• Traditional: Difficult to adapt to changes.
• OO: More adaptable due to the modular structure.
• Maintenance:
• Traditional: Maintenance can be challenging.
• OO: Easier due to the modularity and reusability.
Structured Approach Object Oriented Approach
It works with Top-down approach. It works with Bottom-up approach.
Program is divided into number of Program is organized by having number of
submodules or functions. classes and objects.
Function call is used. Message passing is used.
Software reuse is not possible. Reusability is possible.
Structured design programming usually left Object oriented design programming done
until end phases. concurrently with other phases.
Structured Design is more suitable for
It is suitable for in-house development.
offshoring.
It shows clear transition from design to Not so clear transition from design to
implementation. implementation.
It is suitable for real time system, embedded It is suitable for most business applications,
system and projects where objects are not game development projects, which are
the most useful level of abstraction. expected to customize or extended.
Class diagram, sequence diagram, and use
DFD & E-R diagram model the data.
cases all contribute.
In this approach, projects can be difficult to
In this, projects can be managed easily due
manage due to uncertain transitions
to clearly identifiable phases.
between phase.
Core Concepts of Object-Oriented
Programming (OOP)
• Objects
• Definition: Instances of classes that represent real-world or conceptual
entities, encapsulating data (attributes) and behavior (methods).
• Details:
• State: The data or attributes of an object. For example, a `Car` object might
have attributes such as `color`, `make`, and `model`.
• Behavior: The methods or functions that an object can perform. For example,
a `Car` object might have methods such as `drive ()`, `stop()`, and `fuel()`.
• Identity: A unique identity that distinguishes one object from another, even if
their states are identical.
Examples
• Car Object:
• Attributes: `color = "red"`, `make = "Toyota"`, `model = "Corolla"`
• Methods: `drive () `, `stop () `, `fuel () `
• Person Object:
• Attributes: `name = "John Doe"`, `age = 30`, `gender = "Male"`
• Methods: `walk () `, `talk () `, `sleep () `
Classes
• Classes
• Definition: Blueprints for creating objects. A class defines a type of
object according to the attributes and methods that the objects will
have.
• Details:
• Class Definition: It includes the attributes (data members) and
methods (functions) that define the behavior of the objects.
• Instance: Each object created from a class is called an instance of
that class.
Attributes
• Attributes
• Definition: Properties or data members of a class that hold the state of an
object.
• Details:
• Visibility: Attributes can have different visibility (public, private, protected)
which determines how they can be accessed.
• Data Types: Attributes can be of various data types, including primitive types
(int, float, etc.) and objects.
• Examples:
• Car Class Attributes: `String color`, `String make`, `String model`
• Person Class Attributes: `String name`, `int age`, `String gender`
• Behavior
• Definition: Actions or methods that objects of a class can perform,
representing the behavior of the object.
• Details:
• Method Definition: Includes the method signature (name, parameters) and the
body (code to be executed).
• Method Types: Instance methods (operate on instance data), class methods
(operate on class data, marked with `static` keyword).
Methods
• Methods
• Definition: Functions defined inside a class that describe the behaviors of the
objects.
• Details:
• Method Signature: Includes the method name and parameters.
• Method Body: Contains the code that defines the method’s behavior.
• Return Type: Specifies the type of value the method returns, if any.
• Parameters: Variables passed to the method to customize its behavior.
!!..Thank You.!!

You might also like