3. Introduction
Course Objective
Objective of this course is to make students familiar with the concepts of
Object Oriented Programming
Software Developers are discovering that using a object oriented design and
implementation approach can make software development much more
productive than was possible with earlier popular techniques like “Structured
Programming”.
These concepts will be reinforced by their implementation in Java
3
4. Introduction
Course Contents
The main contents of the course would be:
Object Orientation
Objects & Classes
Overloading & Overriding
Abstraction
Inheritance
Polymorphism
Exception Handling
MultiThreading
4
6. Introduction
Marks Distribution (Theory)
Mid Exam 20% (Min 2 Assignments)
Quiz 10% (Min. 3 Quiz)
Assignment & Class participation 10% (0 marks < 75%)
Final Examination 60% (MCQ, Logical,Theory)
Marks Distribution (Lab)
Attendance 5%
Lab Tasks 5%
Viva 10%
Practical Exam 30%
(Code + Logic + Compilation + Output)
6
7. Object Orientation
What is Object Orientation?
“Object" refers to a particular instance of a class.
whereas the object can be a combination of variables, functions, and data structures.
Object-oriented programming (OOP) is a programming language model
organized around objects rather than "actions" and data rather than “logic”.
Object-oriented or object-orientation is a software engineering concept, in which concepts are
represented as "objects“
It is a technique in which we visualize our programming problems in the form of objects and
their interactions as happened in real life
OO Model consists of several interacting objects.
7
8. Object Orientation
Object Orientation Examples
Consider the objects around us in our daily life. These objects interacts with each
other to perform different operations.
8
Lives in
Drives
11. Object Oriented Model
What is a Model?
A model is abstraction of something.
Purpose is to understand the product before using it.
Example are Highway Map , Architectural Design and Mechanical models.
What is OO Model in Programming?
In the context of programming, Models are used to understand problem before
start developing it.
Object Oriented Models can be developed by showing interaction among
objects to understand a system implementation.
11
14. Object Orientation
Object Orientation - Advantages
An Object Oriented Model Maps directly to reality as seen in the previous
examples.
An Object Oriented Model for a problem can be developed easily
An Object Oriented Model is easily understandable.
An Object Oriented Model objects are reusable.
Implementation
Can be implemented easily by using any Object Oriented Programming
Language Like, Java in our case
14
15. Object Orientation
What is an Object?
An Object is
Something tangible (Ali, School, House, Car)
Something conceptual (that can be apprehended intellectually for example
time date and so on..)
OOP uses objects as its Fundamental Building Blocks
Objects are the basic run time entities in an object oriented system
Every object is associated with data and functions which defines meaningful
operations on that object
Object is a real world existing entity
15
16. Object Orientation
What is an Object?
An Object has
State (Attributes)
Well-defined behaviour (Operations)
Unique Identity
16
17. Object Orientation
What is an Object?
An Object is an entity that has state, behaviour and identity. There are many
object around us.
For Example, a computer mouse is an object. It is considered as an object with
state and behavior
17
20. Object Oriented Programming
What is Object Oriented Programming?
Object Oriented Programming (OOP) is an engineering approach for building
software systems based on the concepts of classes and objects that are used for
modeling real world entities
Object Oriented programming is an approach that provides a way of
modularizing programs by creating partitioned memory area of both data and
functions that can be used as template for creating copies of such modules on
demand
Object Oriented programming is a programming methodology that associates data
structure with a set of operators which act upon it.
20
21. Object Oriented Programming
What is Object Oriented Programming?
Object-oriented programming is a programming methodology characterized by
the following concepts:
1. Abstraction.
2. Encapsulation
3. Information hiding
4. Polymorphism
5. Inheritance
21
Abstraction (from the Latin abs, meaning away from and trahere, meaning to draw) is the process of taking away or removing characteristics from something in order to reduce it to a set of essential characteristics. In object-oriented programming, abstraction is one of three central principles (along with encapsulation and inheritance). Through the process of abstraction, a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency. In the same way that abstraction sometimes works in art, the object that remains is a representation of the original, with unwanted detail omitted. The resulting object itself can be referred to as an abstraction, meaning anamed entity made up of selected attributes and behavior specific to a particular usage of the originating entity. Abstraction is related to both encapsulation and data hiding.
=================
Abstraction and encapsulation are complementary concepts: abstraction focuses on the observable behavior of an object... encapsulation focuses upon the implementation that gives rise to this behavior... encapsulation is most often achieved through information hiding, which is the process of hiding all of the secrets of object that do not contribute to its essential characteristics.
==============================================
Abstraction only expose what is necessary
Encapsulation: hide complexity
Information hiding: which kind of data expose to which