0% found this document useful (0 votes)
3 views

Unit 1 (Lecture 1) PPT_OOP

The document outlines a syllabus for an Object-Oriented Programming course, covering key concepts such as object identity, encapsulation, polymorphism, and various modeling techniques. It emphasizes the importance of Object-Oriented Programming (OOP) in software development, highlighting its advantages over procedural approaches, including modularity, reusability, and improved system quality. Additionally, it discusses the principles of modeling, the purpose of object-oriented modeling, and the relationships among different modeling types.

Uploaded by

tritik59
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Unit 1 (Lecture 1) PPT_OOP

The document outlines a syllabus for an Object-Oriented Programming course, covering key concepts such as object identity, encapsulation, polymorphism, and various modeling techniques. It emphasizes the importance of Object-Oriented Programming (OOP) in software development, highlighting its advantages over procedural approaches, including modularity, reusability, and improved system quality. Additionally, it discusses the principles of modeling, the purpose of object-oriented modeling, and the relationships among different modeling types.

Uploaded by

tritik59
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

KOE-064

Mr. Mandeep Singh


Assistant Professor
CSE Dept., RKGIT

B.Tech (CSE),GGSIPU,
M.Tech- IS, (AIACT&R, GGSIPU),
Ph.D.(P)-CSE, NIT Jalandhar
SYLLABUS

UNIT I
Introduction: The meaning of Object Orientation, object identity, Encapsulation, information
hiding, polymorphism, generosity, importance of modelling, principles of modelling, object oriented
modelling, Introduction to UML, conceptual model of the UML, Architecture.

UNIT II
Basic Structural Modeling: Classes, Relationships, common Mechanisms, and diagrams. Class
&Object Diagrams: Terms, concepts, modelling techniques for Class & Object Diagrams.
Collaboration Diagrams: Terms, Concepts, depicting a message, polymorphism in collaboration
Diagrams, iterated messages, use of self in messages. Sequence Diagrams: Terms, concepts,
depicting asynchronous messages with/without priority, call-back mechanism, broadcast messages.
Basic Behavioural Modeling: Use cases, Use case Diagrams, Activity Diagrams, State Machine ,
Process and thread, Event and signals, Time diagram, interaction diagram, Package diagram.
Architectural Modeling: Component, Deployment, Component diagrams and Deployment
diagrams.
UNIT III
Object Oriented Analysis: Object oriented design, Object design, Combining three models, Designing
algorithms, design optimization, Implementation of control, Adjustment of inheritance, Object
representation, Physical packaging, Documenting design considerations.
Structured analysis and structured design (SA/SD), Jackson Structured Development
(JSD).Mapping object oriented concepts using non-object oriented language, Translating classes into
data structures, Passing arguments to methods, Implementing inheritance, associations encapsulation.
Object oriented programming style: reusability, extensibility, robustness, programming in the
large. Procedural v/s OOP, Object oriented language features. Abstraction and Encapsulation.

UNIT IV
C++ Basics : Overview, Program structure, namespace, identifiers, variables, constants, enum,
operators, typecasting, control structures
C++ Functions : Simple functions, Call and Return by reference, Inline functions, Macro Vs. Inline
functions, Overloading of functions, default arguments, friend functions, virtual functions

UNIT V
Objects and Classes : Basics of object and class in C++, Private and public members, static data
and function members, constructors and their types, destructors, operator overloading, type
conversion. Inheritance : Concept of Inheritance, types of inheritance: single, multiple, multilevel,
hierarchical, hybrid, protected members, overriding, virtual base class
Polymorphism : Pointers in C++, Pointes and Objects, this pointer, virtual and pure virtual
functions, Implementing polymorphism
Course outcome
OVERVIEW

 OBJECT ORIENTED means that we organize software as a collection


of discrete objects that incorporate both data structure and behavior
 This contrasts with previous programming approaches in which data
structure and behavior are loosely connected
Importance of OOP

Real world modeling

Making Data Secure


Improved quality of system due to re-
usability
Reduced development time and effort
Successful Development through
detailed design
Improved Reliability and Flexibility

Easier maintenance
IMPORTANCE

The object-oriented paradigm emphasizes modularity and re-usability.

The goal of an object-oriented approach is to satisfy the "open–closed principle".


• A module is open if it supports extension, or if the module provides standardized ways to add
new behaviours or describe new states. In the object-oriented paradigm this is often
accomplished by creating a new subclass of an existing class.
• A module is closed if it has a well defined stable interface that all other modules must use and
that limits the interaction and potential errors that can be introduced into one module by
changes in another.
Real Time Usage
/Applications of the concept
Object-oriented programming (OOP) is a programming language model that revolves around objects
and not actions. Historically, it was viewed as a procedure that takes input, processes the data, and
gives an output.

Applications of Object-Oriented Programming


1. Client-Server Systems
2. Object-Oriented Databases
3. AI Expert Systems
4. Real-Time System Design
5. Simulation and Modeling System
6. Hypertext and Hypermedia
7. Neural Networking and Parallel Programming
8. Office Automation Systems
LECTURE -1
System Development

 Systems development is the process of defining, designing, testing, and implementing


a new software application or program.
 Programming is used as a tool for System Development.
 There are mainly two approaches:
System
Development
Approaches

Procedural Object
Oriented Oriented
Approach Approach
Procedural Oriented Approach
SECURITY Problem in
Procedural Oriented
Limitations of Procedural Approach

•The program code is harder to write


•The Procedural code is often not reusable
•Difficult to relate with real-world objects
•The importance is given to the operation rather than the data
•The data is exposed to the whole program
Operation Hard to Not
has high Code Reusable
priority

Data Difficult to
exposed Limitations relate
Object MEANING AND DEFINITION
Orientation
Object oriented (OO) Approach

An investigation of the problem (rather than how a solution is defined)

• During OO analysis, there is an emphasis on finding and describing the objects (or
concepts) in the problem domain.
For example, concepts in a Library Information System include Book, and Library.
• Focuses on objects that represent abstract or concrete things in the real world.
• These objects are defined by their character and their properties, which are represented
by their internal structure and their attributes (data).
• The behavior of these objects is described by methods (functions).
• Objects are intended to enable programmers to map a real world problem and its
proposed software solution on a one-to-one basis.
Object oriented (OO) Approach

• Retains all best features of POP method like functions/sub routines, structure etc.
• Added number of concepts which makes efficient programming

Class

Object

Abstraction
Object Oriented
Encapsulation
Features
Inheritance

Polymorphism
Object oriented (OO) Approach

Object Oriented
Features
Difference between Procedure Oriented and
Object-Oriented Approach
Difference between Procedure Oriented and
Object-Oriented Approach
Difference between Procedure Oriented and
Object-Oriented Approach
S. N. Features Object Oriented Approach (OOP) Procedure Oriented Approach (POP)

Full Form OOP stands for Object Oriented Programming. POP stands for Procedural Oriented
1
Programming.
Approach OOP follows bottom-up approach – focused on POP follows top-down approach - focused on
2 building blocks and components. inputs and outputs

Division A program is divided to objects and their A program is divided into functions and
3
interactions. they interact.
Inheritance YES NO support
4
supported
Access control Access control is supported via access modifiers. No access modifiers are supported.
5

Data Hiding Encapsulation is used to hide data. No data hiding present. Data is globally
6
accessible.
7 Example C++, Java, Python, Ruby, GoLang C, Pascal
Top-Down vs Bottom-Up Approach
Interview Question

S. No Question Company(Year)

1 What is OOPS and How it is different from Procedural Programming? Infosys

Ans. Object Orientation Languages (OOL) is concerned to develop an application


based on real time while Procedural Programing Languages (PPL) are more
concerned with the processing of procedures and functions.
In OOL, more emphasis is given on data rather than procedures, while the
programs are divided into Objects and the data is encapsulated (Hidden) from the
external environment, providing more security to data which is not applicable or
rather possible in PPL. In PPL, it’s possible to expose Data and/or variables to
the external entities which is STRICTLY restricted IN OOL.
MCQ
Q Throughout the OOD process, a software engineer should look for every
Company Based Objective Type Questions : -
opportunity for creating new design process.
A
True
B
False
MCQ
Q Throughout the OOD process, a software engineer should look for every
Company Based Objective Type Questions : -
opportunity for creating new design process.
A
True
B
False
Explanation A software engineer should look for every opportunity to reuse existing
design patterns whenever they meet the needs of the design rather than
creating new ones.
Concepts of OOP
-OBJECT

• An object is anything in the real-world.


• It exists in the form of physical or abstract.
• For example, it may represent a person, animal, bird or anything.
• example: Apple, Pencil is an object.
Concepts of OOP

object
OBJECT IDENTITY

• Object Identity describes the property of Objects that distinguishes it from


other Objects.
• Identity is a property of an object that distinguishes the object from all
Concepts of OOP
other objects in the application.

Object Identity Identity


Car Car
Name: Audi Name: Audi
Engine Engine
Number: a123 Number: a125
CLASS

• Class is a group of similar types of objects, having similar features and behavior.
• Example- different objects exists in the real world and based on the common features
these are categorized into different classes Car, Flower and Person.
• Class is used to describe the structure of objects that how the objects will look likes.
• Class is also a pattern or template which produces similar kind of objects.
• Class has data members (attributes) and behavior (functionality).
Concepts of OOP

CLASS
ENCAPSULATION
• Encapsulation is defined as the wrapping up of data under a single unit.
• It is the mechanism that binds together code and the data it manipulates.
• It is a protective shield that prevents the data from being accessed by the code outside
Concepts
this shield.
of OOP

encapsulation
•School bag is one of the most real examples of Encapsulation. School bag can keep our
books, pens, etc.
•In network communication, the data is encapsulated in a single unit in the form of
Concepts of OOP
packets. These packets are delivered over the network.

encapsulation example class Book


String book_title;
String author_name;
+ openBook()
+ closeBook()
+ readBook()
•The encapsulated code is more flexible and easier to change with new requirements.
•It prevents the other classes to access the private fields.
•Encapsulation allows modifying implemented code without breaking other code that
Concepts of OOP
has implemented the code.
•It keeps the data and codes safe from external inheritance.
•Itadvantages of encapsulation
improves the maintainability of the application.
INFORMATION HIDING

• It is closely associated with encapsulation.


• Protects the data from direct modification by other parts of the program.
• It includes a process of combining the data and functions into a single unit by
restricting direct access to the data from outside the class.
• We have objects with their attributes and behaviours that are hidden from other
classes.
Concepts of OOP

Advantages:
• It ensures exclusive data access and prevents intended or unintended changes in the
data.
• It helps in reducing system complexity and increase the robustness of the program.
• It heightens the security against hackers that are unable to access confidential data.
• It prevents programmers from accidental linkage to incorrect data.

Disadvantage:
• It may sometimes force the programmer to use extra coding for creating effects for
hiding the data.
POLYMORPHISM

• Polymorphism = “poly” (many) + “morphs” (forms) = many forms


• It is the ability of a message to be displayed in more than one form.
Concepts of OOP
polymorphism
A same person (Security Guard) can have different behavior in different situations:
1.Like a security guard during competitive Exam ask students to show Identity.
2.In Shopping Mall security guard says welcome Ma’am or Sir and do not say for
identity.
3.In Office guard says Good Morning Sir or Ma’am.
GENEROSITY

It is a property in which container class can be created in which the implementation of


any data types is contained. These classes are popularly known as templates.

Mapping_Fun(key)-> Value
Mapping_Fun(person_name)-> phone_number
Mapping_Fun(ip_address)-> domain_name
Mapping_Fun(aadhaar_number)-> pan_number
MODELLING

• It leads to the deployment of good software.


• It is required to build quality software.
• Communicate the desired structure and behavior of our system.
• To visualize and control the system's architecture.
•modeling
Better understand the system we are building, often exposing opportunities for
simplification and reuse.
• We build models to manage risk."

Modelling can help the development team better visualize the plan of their system and
allow them to develop more rapidly by helping them build the right thing.

The more complex your project, the more likely it is that you will fail or that you will
build the wrong thing if you do on modelling at all.
For example: If you want to build a house for your family with same things, is it
possible? It requires detailed planning, some sketches etc.

Architecting a house is best achieved by a team. It requires detailed modelling, well-


modeling
defined processes and powerful tools.
TYPES OF MODELLING

•A model may be structural, emphasizing the organization of the system, or it may


be behavioral, emphasizing the dynamics of the system.
Types of
Modelling

Structural Behavioural

Organization of Dynamics of
the system the system
IMPORTANCE OF MODELLING

• It gives graphical representation of system to be built.


• It contributes to a successful software organization.
•It is a proven and well accepted engineering technique.
•importance of modeling
A model is a simplification of reality.
• A model provides the blueprint of a system.
Engineerin
g
Software Technique
organizati Reality
on

Graphical
representatio Importance of Blueprint
n Modelling
PRINCIPLES OF MODELLING

• The choice of what models to create.


• Every model may be expressed at different levels of precision.
• The best models are connected to reality
• No single model is sufficient
object oriented modeling (OOM)

• It is the process of preparing and designing what the model’s code will actually look
like.
• Implemented by using the object-oriented programming model.
• OOM consists three phases: analysis, design, and implementation.
• Allows for object identification and communication while supporting data
abstraction, inheritance and encapsulation.
PURPOSE OF OBJECT ORIENTED MODELLING

Testing a physical
entity

Oriented Modelling
Purpose of Object Visualization

Reduced Complexity

Communication with
Customer
• It helps in faster development of software.
• It is easy to maintain.
• It supports relatively hassle-free upgrades.
• It enables reuse of objects, designs, and functions.
•benefit
It reduces of objectrisks,
development oriented
particularlymodeling
in integration of complex systems.

Easy to
Easy upgrade
Maintena Reusability
nce

Faster
developmen Benefit of OO Risk free
t Modelling
Types of model

Types of
Model

Class State Interaction


Model Model Model
Class model

• Shows all the classes present in the system.


• It shows the attributes and the behavior associated with the objects.
• Goal: is to capture those concepts from the real world that are important to an
application.
state model

• Describes those aspects of objects concerned with time and the sequencing of
operations.
• Actions and events in a state diagram become operations on objects in the class
model.
interaction model

• It is used to show the various interactions between objects, how the objects collaborate
to achieve the behavior of the system as a whole.

Interaction Model

Use Sequen
Activity
Case ce
Diagra
Diagra Diagra
m
m m
RELATIONSHIP AMONG THE MODELS

Each Model Describes one aspect of the system but contains references to
the other models.
The class model describes data structure on which the state and interaction
models operate.The operations in the class model correspond to events and
actions.
The state model describes the control structure of objetcs.It shows decisions
thatdepend on object values and causes actions that change object values
and state.
The interaction model focuses on the exchanges between objects and
provides a holistic overview of the operation of a sytem.

You might also like