© S Ramakrishnan, Monash University oops1.ppt 1 Object-Oriented Programming Systems SFT3021 Semester 1 1998 Lecturer: Sita Ramakrishnan

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.
OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
Module 8 “Polymorphism and Inheritance”. Outline Understanding Inheritance Inheritance Diagrams Constructors in Derived Classes Type Compatibility Polymorphism.
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.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Inheritance and object compatibility Object type compatibility An instance of a subclass can be used instead of an instance of the superclass, but not.
Object-Oriented PHP (1)
L3-1-S1 OO Concepts © M.E. Fayad SJSU -- CMPE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
© Wolfgang Pelz Introduction Object-Oriented Methods: Analysis, Design & Programming Dr. Wolfgang Pelz Dr. Yingcai Xiao The University of Akron.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
Introduction To System Analysis and design
UFCEUS-20-2 : Web Programming Lecture 5 : Object Oriented PHP (1)
Programming Languages and Paradigms Object-Oriented Programming.
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.
Introduction to Object-oriented programming and software development Lecture 1.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Chapter 8 More Object Concepts
CISC6795: Spring Object-Oriented Programming: Polymorphism.
CSM-Java Programming-I Spring,2005 Objects and Classes Overview Lesson - 1.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
An Object-Oriented Approach to Programming Logic and Design
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
CONCEPTS OF OBJECT ORIENTED PROGRAMMING. Topics To Be Discussed………………………. Objects Classes Data Abstraction and Encapsulation Inheritance Polymorphism.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
Object Oriented Programming April 13, Problem Description “ …Wombats are allowed to have different directions and number of eaten leaves, move,
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.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
Object-Oriented Programming. An object is anything that can be represented by data in a computer’s memory and manipulated by a computer program.
Parameters… Classes Cont Mrs. C. Furman October 13, 2008.
OOP: Encapsulation,Abstraction & Polymorphism. What is Encapsulation Described as a protective barrier that prevents the code and data being randomly.
Object-Oriented Design Justin Callanan CS 597. Object-Oriented Basics ● Data is stored and processed in “objects” ● Objects represent generalized real.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Lecture 12 March 16, The Scope of a Variable What if there are two variables with the same name? –A local or block-local variable can have the same.
Object-Oriented Programming with Java Lecture 1: Introduction Autumn, 2007.
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
: Maha Sabri Altememe Lecturer : Maha Sabri Altememe Lecture :1 1.
Basic Concepts of Object Orientation Object-Oriented Analysis CIM2566 Bavy LI.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
(1) ICS 313: Programming Language Theory Chapter 12: Object Oriented Programming.
Object Oriented Programming
OOP Review CS 124.
OO in Context Lecture 13: Dolores Zage. Confused about OO Not alone, there is much confusion about OO many programs are claimed to be OO but are not really.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
1 Lecture 23: Dynamic Binding (Section ) CSCI 431 Programming Languages Fall 2002 A compilation of material developed by Felix Hernandez-Campos.
A Survey of Object-Oriented Concept Oscar Nierstrasz.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
COMPUTER SCIENCE & TECHNOLOGY DEGREE PROGRAMME FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UVA WELLASSA ‏ Properties of Object Oriented Programming.
CSCE 240 – Intro to Software Engineering Lecture 3.
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Inheritance Modern object-oriented (OO) programming languages provide 3 capabilities: encapsulation inheritance polymorphism which can improve the design,
Object-Oriented Programming
Polymorphism in Methods
OOP What is problem? Solution? OOP
Object Oriented Analysis and Design
Workshop for Programming And Systems Management Teachers
Object-Oriented PHP (1)
Object-Oriented Programming
Object Oriented Programming(OOP)
Computer Science II for Majors
Presentation transcript:

© S Ramakrishnan, Monash University oops1.ppt 1 Object-Oriented Programming Systems SFT3021 Semester Lecturer: Sita Ramakrishnan

© S Ramakrishnan, Monash University oops1.ppt 2 OO Concepts & Terminology u OOP based on 4 key software engineering principles: u Abstraction u Encapsulation u Inheritance u Polymorphism

© S Ramakrishnan, Monash University oops1.ppt 3 Abstraction u A simplified specification of a system that emphasises some of the systems’ details while suppressing others (M Shaw: Abstraction techniques in Programming)

© S Ramakrishnan, Monash University oops1.ppt 4 Data Abstractions u users focussing on the essential features of the object, based on their perspective u CAR - licence plate, premium due,... (RACV) u CAR - service records, rego due,... (Owner)

© S Ramakrishnan, Monash University oops1.ppt 5 Encapsulation u Datatype, data and operation bundled together as a unit u compared to traditional programming model where u data allocated in memory u data manipulated by code from subroutines or functions

© S Ramakrishnan, Monash University oops1.ppt 6 Encapsulation u Wrapped up (encapsulated) object contains data and code u Protected from arbitrary access by other code - access only through public interfaces u Basis of Encapsulation is a Class in Eiffel

© S Ramakrishnan, Monash University oops1.ppt 7 Inheritance u OOP enables users to build on a class that is already defined u Ability to declare a new type from existing type by building on the data and methods of the existing type u Inherited class - case of specialization or extension or replacement of parent features

© S Ramakrishnan, Monash University oops1.ppt 8 Inheritance u view real world objects with hierarchical relationships u to define an Account in an abstract way, consider their attributes & behaviours u account attributes - account number, overdraft allowed,... u account behaviours (operations) - deposit, display,...

© S Ramakrishnan, Monash University oops1.ppt 9 Inheritance u Describe a more specific class of Account u cheque_account with more specific attributes & operations u In OOPs, declare that new type is related to existing Account class u program only the differences between the 2 types

© S Ramakrishnan, Monash University oops1.ppt 10 Inheritance u is-a relationship u subtype is-a Type (Class) with additional functionality u CHEQUE_ACCOUNT is-a ACCOUNT with... u CONFERENCE_ATTENDEE is-a PERSON with... u for operations e.g. display that apply to both object types - one can provide either object u compare with client-supplier relationship re: encapsulation

© S Ramakrishnan, Monash University oops1.ppt 11 Polymorphism u Greek term for many shapes u use the same name to refer to various methods - name sharing u 2 types - i) overloading, ii)true polymorphism u i) use same name for various methods in a class - types or no. of parameters different - so compiler can know which synonym to use u i) eg. smell method in DOG Class with cat or food objects as parameters - show behaviours - bark or run to eat!

© S Ramakrishnan, Monash University oops1.ppt 12 Polymorphism u ii) True Polymorphism - resolved at run time u subclass has a method with the same name & signature (type, number & order of parameters) as the parent class method u if that is so, subclass method overrides superclass method u eg: serve method in Vegetable & subclass Green Salad - correct serve chosen at run time based on which object is referred to - polymorphism

© S Ramakrishnan, Monash University oops1.ppt 13 Polymorphism u Overloading resolved by the compiler at compile time (static) - inflexible u compiler chooses one from a no. of methods with the same name by matching on argument types u Overriding resolved at run time u extend functionality by subclassing - ability to override u choosing the correct method - late binding u Polymorphism - language feature that allows 2 methods with same name - such that late binding may be applied

© S Ramakrishnan, Monash University oops1.ppt 14 Polymorphism u information passed to methods on objects as parameters to method invocation u parameters - list of typed values that make up input data to a particular message u method - can be viewed as a parameterised message u compare to trad. prog - different operations need separate functions with different names