Object Orientated Programming

Slides:



Advertisements
Similar presentations
Object Oriented Programming
Advertisements

Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
When is Orientated Programming NOT? Mike Fitzpatrick.
Data Structures.
1 OBJECT-ORIENTED CONCEPTS. 2 What is an object?  An object is a software entity that mirrors the real world in some way.  A software object in OOP.
Plato and Aristotle MUST – Explain Plato’s Cave allegory and Theory of Forms. SHOULD – Evaluate Plato using Aristotle. COULD – Defend and challenge Aristotle’s.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
BACS 287 Basics of Object-Oriented Programming 1.
Overview-An Overview of Visual Basic.NET1 An Overview of Visual Basic.NET.
UFCEUS-20-2 : Web Programming Lecture 5 : Object Oriented PHP (1)
C++ Object Oriented 1. Class and Object The main purpose of C++ programming is to add object orientation to the C programming language and classes are.
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to Object-oriented programming and software development Lecture 1.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
An Object-Oriented Approach to Programming Logic and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
Object Oriented Programming Concepts. Object Oriented Programming Type of programming whereby the programmer defines the data types of a data structure.
Chapter 2: Reality Two Kinds of Metaphysics: Plato and Aristotle
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
Abstraction ADTs, Information Hiding and Encapsulation.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
1.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
“everything is an object”. Class Template Code for defining an object Objects are created with NEW keyword (method) Namespace – (disambiguation) Context.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science)
Chapter More on Classes Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
1 C++ Classes & Object Oriented Programming Overview & Terminology.
Metaphysics Aristotle and Plato.
Ideal World/World of Forms.  c B.C.E. Athens, Ancient Greece  Teacher of Aristotle  Influenced by Socrates, Heraclitus, Parmenides and the.
Chapter 11: Abstract Data Types Lecture # 17. Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract.
Copyright ©2005  Department of Computer & Information Science Object Oriented Concepts.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
What is an Object Objects are key to understanding object-oriented technology. An object can be considered a "thing" that can perform a set of related.
Object-Orientated Programming
Object Oriented Programming
Object-Oriented Programming Concepts
Sachin Malhotra Saurabh Choudhary
CHAPTER 5 GENERAL OOP CONCEPTS.
Chapter 1: An Introduction to Visual Basic 2015
Plato on Being Plato believed that ________________________________________________________________________________ All particular things that _________.
Programming in Java Sachin Malhotra, Chairperson, PGDM-IT, IMS Ghaziabad Saurabh Chaudhary, Dean, Academics, IMS Ghaziabad.
The Object-Oriented Thought Process Chapter 1
Plato Introduction.
Concept Innatism.
Object Oriented Concepts -II
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
C++.
Object Oriented Concepts
Chapter 7 Classes & Objects.
Computer Programming.
Subprograms and Programmer Defined Data Type
Teach A-Level Computer Science: Object-Oriented Programming in Python
Chapter 9 Classes & Objects.
Object-Oriented Programming
Programming paradigms
Do we directly perceive objects? (25 marks)
Workshop for Programming And Systems Management Teachers
Object Oriented Analysis and Design
Object-Oriented PHP (1)
Object-Oriented Programming
Object Oriented Design & Analysis
C++ Object Oriented 1.
Presentation transcript:

Object Orientated Programming Abstraction Inheritance Polymorphism encapsulation

The 4 pillars of Object Oriented Programming INHERITANCE ENCAPSULATION POLYMORPHISM ABSTRACTION

In a nutshell, inheritance is a process of creating new class from the existing one. The new class may have some additional properties and functionality. INHERITANCE

Encapsulation is the process of putting data and the operations (functions) that can be performed on that data into a single container called class. Now, any programmer can use this class without knowing how it is implemented. Due to encapsulation, data is insulated, thus not directly accessible from the outside world. This is known as Data Hiding. Remember, Encapsulation is not data hiding, but, Encapsulation leads to data hiding. ENCAPSULATION

Note on encapsulation – a helpful illustration A tiger can walk, smell, eat, hunt, kill and eat … The tiger can do all of these functions without ever knowing or seeing how it does them.

Poly means many and Morphs means forms Poly means many and Morphs means forms. Polymorphism refers to the ability to take multiple forms and it allows us to invoke derived class methods through a base class reference during run-time.. POLYMORPHISM

Abstraction is a process of exposing essential features of an entity by hiding the other irrelevant details. Abstraction mainly reduces complexity and increases efficiency. An entity can have multiple abstractions. ABSTRACTION

Note on Abstraction Source: https://www.google.co.uk/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0CAcQjRw&url=http%3A%2F%2Fwww.slideshare.net%2Fdmccreary%2Fsemantic-integrationpatterns&ei=wFpOVYTcJszy7AaJuYHABg&bvm=bv.92885102,d.ZGU&psig=AFQjCNHAdexlzOKpnKBo0YUj9djJvj374g&ust=1431284782665773

Object Oriented Programming This makes use of the idea of CLASSES and OBJECTS A Class is created (as a sort of ultimate BLUEPRINT or TEMPLATE) of an object. All Objects are then INSTANCES (or instantiations) of that CLASS.

PLATO Plato was born in Athens, Greece in the year 428 BCE and was tutored by Socrates (often credited as the father of Western philosophy). However, it is Plato, not Socrates, who is arguably the best known of the ancient Greek philosophers (if not of all philosophers), due in large to his profound influence on modern philosophy through his legacy of prolific writings; 35 dialogues  and 13 letters.

Theory of Forms Beautiful?

What is Beauty?

Can the thing we call “beauty” be personified? What is Beauty?

Can the thing we call “beauty” be personified? What is Beauty?

The “Form” of True Beauty A flower is beautiful and a picture can also be said to be beautiful, but neither are beauty itself. Plato argues that the form of true beauty exists independently of the objects that have it, as such we may have a notion of perfect beauty, but can never actually experience it first hand.

Beauty is a quality INHERITED from the true form BEAUTY (that exists … Beauty is a quality INHERITED from the true form BEAUTY (that exists ….somewhere!) In Plato’s parlance, a flower is said to partake of the form of beauty. It’s beautiful, but we never see true beauty. The flower is said to be a particular that inherits its qualities from the forms, one of which is beauty. The form of true beauty is constant and unchanging, whereas a flower may possess beauty for a while, but ultimately looses it when it withers and dies. Being abstract, forms exist independently of the particulars or real world objects that inherit their qualities.

Plato’s ideas are tat Every OBJECT, thing, thought or IDEA in this world is merely an “INSTANCE” or a MANIFESTATION of a TRUE AND ABSOLUTE TEMPLATE (or Class) of that object that exists in TRUE REALITY

Take Chairs…. A Chair (or a Chair Class) is like a TEMPLATE or an ABSTRACT (idea) of what a CHAIR is. The Chair class tells us WHAT A CHAIR COMPRISES OF, WHAT IT CAN DO, WHAT IT SHOULD LIKE, etc. A Chair Has legs Can be sat on Has a Colour Has a Shape

If a Carpenter made a Chair now …. The Chair INHERITS properties and methods from the original IDEA of a Chair. In programming we could call this a CLASS

Take Visual Basic and Buttons When you create a Button on a form you are: 1. Creating an INSTANCE of the BUTTON CLASS (The button class already exists and you cannot change it) The Button class defines what a Button is – what properties and events and methods it has. Every button you create can be clicked….will have a shape etc.

Everything in the toolbox has already been created as a Class.

When you make a button – you make an instance of the button class.

Pre-defined Properties of the Button Pre-defined Properties of the Button! (these are INHERITED from the Button Class)

C = Procedural Language What could go wrong here?

The main idea of OOP Is: To gather data AND Methods (functions) that act upon that data into ONE entity – called a CLASS. When you have a class it means 1 DATA HIDING 2 CODE RE-USE and 3 PROGRAM MAINTENANCE much easier!

Classes can be thought of as “Black Boxes” Other programmers don’t know what the class contains but can manipulate it using its METHODS

Languages in the olden days Treated data and Programming instructions as separate things

Derived Class? A Class that has all the properties and methods (or attributes and operations) of its super class but may also have attributes and operations of its own!

The 4 pillars of Object Oriented Programming INHERITANCE ENCAPSULATION POLYMORPHISM ABSTRACTION

Inheritance? A Derived Class INHERITS all the attributes and operations from its super class.

Encapsulation? Data Hiding Data can only be accessed using operations or methods defined for the class Maintains data integrity

Polymorphism Data Hiding Data can only be accessed using operations or methods defined for the class Maintains data integrity

What are the advantages of OOP?

Disadvantages of OOP?

From http://www. richardfarrar Throughout his metaphysical discussions, Plato refers to forms as abstract representations that are templates or patterns for real world objects or characteristics of objects. By way of example, to explain the concept of a form, Plato discusses the concept of beauty. A flower is beautiful and a picture can also be said to be beautiful, but neither are beauty itself. Plato argues that the form  of true beauty exists independently of the objects that have it, as such we may have a notion of perfect beauty, but can never actually experience it first hand. In Plato’s parlance, a flower is said to partake of the form of beauty. It’s beautiful, but we never see true beauty. The flower is said to be a particular that inherits its qualities from the forms, one of which is beauty. The form of true beauty is constant and unchanging, whereas a flower may possess beauty for a while, but ultimately looses it when it withers and dies. Being abstract, forms exist independently of the particulars or real world objects that inherit their qualities. Heavy stuff at the best of times, let alone for over two millennia ago.