CSC238 INTRODUCTION TO OOP Chapter 1.

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

OOP - Object Oriented Programming Object Oriented Programming is an approach to programming that was developed to make large programs easier to manage.
Objectives Introduction to Inheritance and Composition (Subclasses and SuperClasses) Overriding (and extending), and inheriting methods and constructors.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
CS-2135 Object Oriented Programming
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and.
Stéphane Ducasse6.1 Essential Concepts Why OO? What is OO? What are the benefits? What are the KEY concepts? Basis for all the lectures.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Chapter Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Object-oriented Programming Concepts
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Lecture 1 Introduction to Computers and Object-
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 1 Introduction to Object-Oriented Programming.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
INTRODUCTION TO JAVA PROGRAMMING Chapter 1. What is Computer Programming?
C++ fundamentals.
BACS 287 Basics of Object-Oriented Programming 1.
Object Oriented Programming
UFCEUS-20-2 : Web Programming Lecture 5 : Object Oriented PHP (1)
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 1: Introduction to Object-Oriented Programming.
BCS 2143 Introduction to Object Oriented and Software Development.
CSM-Java Programming-I Spring,2005 Objects and Classes Overview Lesson - 1.
An Object-Oriented Approach to Programming Logic and Design
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.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
© S Ramakrishnan, Monash University oops1.ppt 1 Object-Oriented Programming Systems SFT3021 Semester Lecturer: Sita Ramakrishnan
Object-Oriented Programming (OOP) CSC-2071 (3+1=4 Credits) Lecture No. 1 MBY.
Object-Oriented Programming
IT 21103/41103 System Analysis & Design. Chapter 05 Object Modeling.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
CSC241 Object-Oriented Programming (OOP) Lecture No. 1.
BCS 2143 Object Oriented Design Using UML. Objectives Objects Interactions Finding Classes Relationship Between Classes Attribute and Operation Class.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Learners Support Publications Object Oriented Programming.
: Maha Sabri Altememe Lecturer : Maha Sabri Altememe Lecture :1 1.
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
Basic Concepts of Object Orientation Object-Oriented Analysis CIM2566 Bavy LI.
1 OOP - An Introduction ISQS 6337 John R. Durrett.
(1) ICS 313: Programming Language Theory Chapter 12: Object Oriented Programming.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Lecture 2: Review of Object Orientation. © Lethbridge/La ganière 2005 Chapter 2: Review of Object Orientation What is Object Orientation? Procedural.
Object-Oriented Concepts Overview. Florida Community College at Jacksonville COP 2551 Object-Oriented Programming OO Concepts Overview Objective Overview.
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Object-Oriented Paradigm (OOP) Course Code: SE 101 Lecture No. 1.
Programming Paradigms(Model) Two Paradigms: – Procedural Programming Paradigm – Object Oriented Paradigm Objective of OO approach is to eliminate some.
COMPUTER SCIENCE & TECHNOLOGY DEGREE PROGRAMME FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UVA WELLASSA ‏ Properties of Object Oriented Programming.
Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes.
Geoff Holmes and Bernhard Pfahringer COMP206-08S General Programming 2.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
OOP - Object Oriented Programming
Object Oriented Programming
Sachin Malhotra Saurabh Choudhary
Intro to OOP with Java, C. Thomas Wu CHAPTER 2 Introduction to OOP
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Types of Programming Languages
Object Oriented Analysis and Design
Chapter 10 Thinking in Objects
Teach A-Level Computer Science: Object-Oriented Programming in Python
Object Oriented Programming
Object-Oriented PHP (1)
Object-Oriented Programming
Object Oriented Programming(OOP)
Presentation transcript:

CSC238 INTRODUCTION TO OOP Chapter 1

Objectives At the end of this topic, you should be able to know the elements of an object. differentiate between objects and classes. understand the characteristics of OOP. NH2008

Object Objects are key to understanding object-oriented technology. In real life, things that you see such as cars, trees, cats, mobile phones and so on are objects. Even, you as a student is an object. Each object has states , behaviours and identity. NH2008

Elements of an Object OBJECT Attribute /state – properties used to define characteristics. OBJECT Behaviour – means the object can perform actions & can have actions performed on it. Identity – means the object can be called & used as a single unit. NH2008

Example 1: An air-conditioner at MK02 State : Turn on Current temperature is at 20 degree celcius Behaviours : Change the temperature level NH2008

Example 2: A Siamese Cat State : Dark brown colours on its face, ears and feet Behaviours : Playing, fighting, hunting NH2008

Example 3: How about the following cats? They are 3 different cats which two of them are of the same type. What makes them different?  their states , behaviours and identity. NH2008

Example 4: Different types of cats Share the same behaviours NH2008

Example 5: How about these cars? Try to identify their common attributes and behaviours . NH2008

Lesson Learned… What can you tell from example 3 to 5? A group of animals or things that are similar in some way. They share the same attributes and behaviours. This group of objects represents a class. NH2008

Class ? Object ? Class Object a kind of template. represents the common structure & behaviour shared by the same type. A collection of objects of similar type. must be defined before creating an instance of the class. a thing, both tangible and intangible. is comprised of data & operations that manipulate these data. is called an instance of a class. NH2008

Example 6: Variables Represents the data/ attributes variables. Student name id setName() setId() Represents the data/ attributes variables. a set of properties Methods class Represents the behaviours. A sequence of instructions that a class or an object follows to perform a task. : Student name=“Sarah” id=“1234” object / instance of the class NH2008

Messages An object can’t exist on its own. An object communicates with other objects. Therefore, a message is used to instruct a class or an object to perform a task. An object or a class only responds to messages that it can understand. Messages must match the method that it possess. A list of messages is called an interface. NH2008

Characteristics of OOP Abstraction Encapsulation Inheritance Polymorphism NH2008

Characteristic of OOP Abstraction Encapsulation the act of representing essential features without including the background details or explanations. Use to manage complexity Abstraction can be managed through the use of hierarchical classifications. The mechanism that binds together code and the data it manipulates and keeps both safe from the outside interference and misuse. Access to the code & data inside the wrapper is tightly controlled through a well-defined interface. NH2008

Example 7: Variables: name student id address course Methods: changeAddress(String) changeCourse(String) Student INTERFACE changeAddress(String) changeCourse(String) NH2008

Characteristics of OOP Inheritance The process by which one object acquires the properties of another object. An object need only to define all those qualities that make it unique within its class. It inherits its general attributes from its parent. A subclass has at least one attribute/method that differs from its superclass Other names :base class-derived class, parent class-child class NH2008

Example 8: Mobile Phone MobilePhone model manufacturer price … CameraPhone model manufacturer price pixel … MobilePhone model manufacturer price … PdaPhone model manufacturer price memoryCap … subclass superclass subclass NH2008

Characteristics of OOP Polymorphism From the Greek, meaning “many forms”. A feature that allows one interface to be used for a general class of actions. “one interface, multiple methods” Can be applied in the overloaded methods (a few methods that have the same name but with different parameters). NH2008

Example 9: Class : Rectangle Variables : length, width, height Methods : …. displayShape(char simbol) displayShape(int a) This class has 2 methods with the same name but with different type of parameters NH2008

Conclusion Elements of an object are attribute, behaviour and identity. A class is a collection of objects of similar type. An object is comprised of data and operations that manipulate these data. Characteristics of OOP is abstraction, encapsulation, inheritance and polymorphism. NH2008