Object-Oriented Programming

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

By Waqas Over the many years the people have studied software-development approaches to figure out which approaches are quickest, cheapest, most.
1 Object-Oriented Programming Concepts. 2 Recap from last lecture Variables and types –int count Assignments –count = 55 Arithmetic expressions –result.
L3-1-S1 OO Concepts © M.E. Fayad SJSU -- CMPE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
What is an object? Your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior;
Object-oriented Programming Concepts
Chapter 10 Classes Continued
INTRODUCTION TO JAVA PROGRAMMING Chapter 1. What is Computer Programming?
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Introduction to Object-oriented programming and software development Lecture 1.
CSM-Java Programming-I Spring,2005 Objects and Classes Overview Lesson - 1.
An Object-Oriented Approach to Programming Logic and Design
Features of Object Oriented Programming Lec.4. ABSTRACTION AND ENCAPSULATION Computer programs can be very complex, perhaps the most complicated artifact.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Object-Oriented Programming (OOP) CSC-2071 (3+1=4 Credits) Lecture No. 1 MBY.
Objected Oriented Programming & Design JAVA Shishir Gupta (704) (704)
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Object Oriented Programming Principles Lecturer: Kalamullah Ramli Electrical Engineering Dept. University of Indonesia Session-3.
Object-Oriented Programming with Java Lecture 1: Introduction Autumn, 2007.
Learners Support Publications Object Oriented Programming.
Summing Up Object Oriented Design. Four Major Components: Abstraction modeling real-life entities by essential information only Encapsulation clustering.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Lecture 12 Implementation Issues with Polymorphism.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
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.
Introduction to Object-oriented Programming
Object-Oriented Programming
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.
Visit for more Learning Resources
Object Oriented Programming
Object-Oriented Programming Concepts
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Sachin Malhotra Saurabh Choudhary
JAVA By Waqas.
The Movement To Objects
CHAPTER 5 GENERAL OOP CONCEPTS.
Inheritance and Polymorphism
The Object-Oriented Thought Process Chapter 1
Chapter 11 Object-Oriented Design
OOP What is problem? Solution? OOP
Object Oriented Programming in Java
JAVA Introduction ការណែនាំពី Java
Object-Oriented Programming
Inheritance Modern object-oriented (OO) programming languages provide 3 capabilities: encapsulation inheritance polymorphism which can improve the design,
Week 4 Object-Oriented Programming (1): Inheritance
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
An Introduction to Inheritance
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
TIM 58 Chapter 8: Class and Method Design
Object Oriented Concepts
Inheritance B.Ramamurthy 11/7/2018 B.Ramamurthy.
Object Oriented Analysis and Design
Chapter 10 Thinking in Objects
Object-oriented Design in Processing
CIS601: Object-Oriented Programming in C++
Object-Oriented Programming: Inheritance and Polymorphism
Workshop for Programming And Systems Management Teachers
What Is Good Software(Program)?
Object Oriented Analysis and Design
Agenda Software development (SD) & Software development methodologies (SDM) Orthogonal views of the software OOSD Methodology Why an Object Orientation?
The Object Paradigm Classes – Templates for creating objects
Presentation transcript:

Object-Oriented Programming Lecture 05 Introduction to Object-Oriented Programming Jaeki Song

Outlines Characteristics of OOP Object Class Inheritance Polymorphism

Principles of Good Programming Modularity Reusability Extensibility Ease of maintenance Preservation of data integrity Efficient debugging

Characteristics of OOP Everything is an object A program is a bunch of objects telling each other what to do by sending messages Each object has its own memory made up of other objects Every object has a type All objects of a particular type can receive the same message

Object A natural “thing” Any object can be identified, classified, and defined E.g., dog, desk, television set, bicycle Objects are key to understanding object-oriented technology Each object has a set of attributes that describe it Desk can be described in terms of its weight, color, and the material it is made of

Object Has a unique identity Object knows (state) and can do (behavior) The state consists of a set of fields with current values The behavior is defined by a set of methods Change gear Methods (behavior) Variables (state) 3rd gear brake

Object: Message Objects interact and communicate with each other by sending message to each other changeGears (lowGear) Your car You

Object: Message Important benefits An object’s behavior is expressed through its methods Message passing supports all possible interaction between objects Object don’t need to be in the same process

Object Combination of data and code (or methods) The process of packaging an objects’ data together with its code is termed “data encapsulation” E.g. Car (Object) has data variables (describing the state of car including car’s engine type, its current speed, its make, and its model). A car also has methods (brake, accelate, changeGear) operating on its data

Object Encapsulation provides the ability to hide data “data hiding” Objects are composed of internal (private) sections and external (public) sections Private is a combination of internal data and methods External section is often referred to as its “interface” Presents everything that the external users of the object need to know or are allowed to know

Class Each individual object in a class is called an instance of that class Change gear Change gear currentSpeed = 50 currentSpeed = 75 brake brake currentGear = 4 currentGear=3 MyCar YourCar

Class Can be created by defining all the data and associated methods for a given set of objects Provides the benefit of reusability Reuse the code of a given class many times to create new objects Each object gets its own data but shares a single set of methods with other objects in its class

Class Hierarchical structure Supper class vs. subclass Every class is derived from a superclass classKeyword and classBody classKeyword-identifier, nameOfClass classBody – dataVariables (instance variables) and methods

Access Control The goal of class creator (those who create class) is to build a class that exposes only what’s necessary to the client programmer (the class consumers who use the class in their application) and keeps everything else hidden Class creator can change the hidden portion without worrying about the impact to anyone else Class creator can change the internal working of the class without worrying about how it will affect the client programmer Java use three boundaries public, private, and protected

Reusability Use an object of the class directly Place an object of the class inside a new class “creating a member object”  composition or aggregation car engine “A car has an engine”

Inheritance A new class can be defined which inherits all the attributes that have been defined for an existing class Inheritance provides the benefit of code reusability

Inheritance Take the existing class, clone it, and then make additions and modifications to the clone However, if the original class (bass or super or parent class) is changed, the modified “clone” (inherited or sub or child class) reflects those changes

Inheritance A super class contains all of the characteristics and behaviors that are shared among the classes derived from it Create a supper class to represent the core of your idea and derive other classes to express the different ways that this core can be realized

Inheritance Shape draw() erase() move() Circle Square Triangle draw() FlipVertical() FlipHorizontal() extension

Polymorphism Greek words “Multiple” and “Shape” Perform the same operation on different types of classes as long as they share a common trait Define a generic command which is implemented by a number of related classes Helps avoid complexity and redundancy

Polymorphism Interchangeable objects Allows an instruction to be given to an object using a generalized, rather than a specifically detailed Two forms Method overloading Different types of information in the message being sent to an object Method overriding Dynamic binding