Unit 1 (Lecture 1) PPT_OOP
Unit 1 (Lecture 1) PPT_OOP
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
Easier maintenance
IMPORTANCE
Procedural Object
Oriented Oriented
Approach Approach
Procedural Oriented Approach
SECURITY Problem in
Procedural Oriented
Limitations of Procedural Approach
Data Difficult to
exposed Limitations relate
Object MEANING AND DEFINITION
Orientation
Object oriented (OO) Approach
• 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)
object
OBJECT IDENTITY
• 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.
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
Mapping_Fun(key)-> Value
Mapping_Fun(person_name)-> phone_number
Mapping_Fun(ip_address)-> domain_name
Mapping_Fun(aadhaar_number)-> pan_number
MODELLING
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.
Structural Behavioural
Organization of Dynamics of
the system the system
IMPORTANCE OF MODELLING
Graphical
representatio Importance of Blueprint
n Modelling
PRINCIPLES OF MODELLING
• 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
• 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.