Object Oriented Programming Concepts. Object Oriented Programming Type of programming whereby the programmer defines the data types of a data structure.

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

When is Orientated Programming NOT? Mike Fitzpatrick.
4. Object-Oriented Programming Procedural programming Structs and objects Object-oriented programming Concepts and terminology Related keywords.
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Visual Basic: An Object Oriented Approach 2 – Designing Software Systems.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
CS 211 Inheritance AAA.
Introduction to Object Oriented Programming Java.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Fall 2007ACS-1805 Ron McFadyen1 Programming Concepts Chapter 4 introduces more advanced OO programming techniques. Construction of a programs usually requires:
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
1 Evan Korth New York University Inheritance and Polymorphism Professor Evan Korth New York University.
Object-oriented Programming Concepts
1 Evan Korth New York University Inheritance and Polymorphism Professor Evan Korth New York University.
Data Abstraction and Object- Oriented Programming CS351 – Programming Paradigms.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
C++ fundamentals.
BACS 287 Basics of Object-Oriented Programming 1.
Abstraction, Inheritance, and Polymorphism in Java.
Object Oriented Software Development
UFCEUS-20-2 : Web Programming Lecture 5 : Object Oriented PHP (1)
Object Orientation An Object oriented approach views systems and programs as a collection of interacting objects. An object is a thing in a computer system.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
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 with JAVA Arash N. Kia AlZahra University Definitions – Part 1.
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.
1 Classes and Controls CE-105 Spring 2007 By: Engr. Faisal ur Rehman.
Object Oriented Software Development
Learners Support Publications Object Oriented Programming.
Object-Oriented Application Development Using VB.NET 1 Chapter 8 Understanding Inheritance and Interfaces.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
8. Inheritance “Is-a” Relationship. Topics Creating Subclasses Overriding Methods Class Hierarchies Abstract Class Inheritance and GUIs The Timer Class.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
VB Classes ISYS 512/812. Object-Oriented Concepts Abstraction: –To create a model of an object, for the purpose of determining the characteristics (properties)
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
Programming Paradigms Different paradigms Procedural paradigm, e.g. Pascal Basic Functional paradigm, e.g. Lisp Declarative paradigm, e.g. Prolog Object-Oriented.
Classes, Interfaces and Packages
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.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
CSE 2341 Object Oriented Programming with C++ Note Set #4
Software Construction Lab 05 Abstraction, Inheritance, and Polymorphism in Java.
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.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
CE-105 Spring 2007 By: Engr. Faisal ur Rehman
JAVA By Waqas.
CHAPTER 5 GENERAL OOP CONCEPTS.
The Object-Oriented Thought Process Chapter 1
OOP What is problem? Solution? OOP
Object Oriented Concepts -I
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Object Oriented Analysis and Design
Object oriented vs procedural programming
Programming paradigms
Object-Oriented Programming
Object-Oriented PHP (1)
Object-Oriented Programming
Programming For Big Data
The Object Paradigm Classes – Templates for creating objects
Presentation transcript:

Object Oriented Programming Concepts

Object Oriented Programming Type of programming whereby the programmer defines the data types of a data structure the type of operations (methods/functions) that can be applied to the data structure In this way the data structure becomes an object that includes both data and methods or functions OOP allows developers to create reusable objects that interact with each other. Uses the ‘bottom-up’ approach

Class A "Class" is a template or blue print which defines the attributes (properties) the actions or methods which can be performed upon those attributes for a given type of entity. E.g. Snake can be a class attributes: avgNoOfEggs, colour, length, dob methods: how it eats its prey (eats it whole) how it moves (uses tummy muscles)

Sub Class The class at the top of the hierarchy of classes is known as the super class. Classes that derive from this class are known as subclasses or child classes. E.g. Constrictor is sub class of Snake Venomous is sub class of Snake

Inheritance snake Constrictor Boa Constrictor Anaconda Venomous cobraviper

Object An object is an "Instance" of a Class. The class definition is used to create "Instances" of the class, which are the actual objects used within your application. Objects define what it knows and how it functions E.g. class: Snake Object 1 : Cesar is an instance of the Boa Constrictor class which is in turn a subclass of Constrictor and inherits from Snake

Encapsulation The process of combining data and methods together in one class. It means ‘Packaged together’. Encapsulation is implemented in Java through access modifiers. Parts of the object are accessible to other objects and some parts remain hidden

Public Class Snake Private snakeName As String Private dob As Date Public Sub New() End Sub Public Sub New(ByVal sname As String, ByVal sdob As Date) snakeName = sname dob = sdob End Sub Public Sub setSnakeName(ByVal sname As String) snakeName = sname End Sub Public function getSnakeName() as string return snakeName End Sub End Class

Inheritance Is when objects derive attributes and behaviours from other objects Reduces the amount of new code required to implement a system Allows new objects to be created from old objects E.g.Class Snakes Each object created from class Snakes inherits ‘lays eggs’ attribute from Snakes

Polymorphism Polymorphism literally means “many forms”. It means that different objects respond to the same message with different methods. Polymorphism takes advantage of inheritance and interface implementations.

Polymorphism Constrictors versus Poisonous Snakes All snakes KILL but the way they kill their prey is different!! What action common to all snakes but carried out differently depending on the type of snake?

Polymorphism Both sub classes inherit the method signature i.e. method name and parameters must be the same but the actual coding will be different E.g. Venomous Snakes kill using their fangs / venom Constrictors kill their victims by suffocating them

How does memory management work with components on a form? Dim myButton(10) As Button For i=0 to 10 myButton(i) = New Button myButton(i).Top=i*10 myButton(i).Left= 100 Next 101Button Code 100Button Code myButton(4) properties 37myButton(4) properties i is pointer to location of address

Advantages of OOP Isolation of objects from one to another Objects can only communicate through known means One object is unable to influence the internal operations of another object Objects support the idea of ‘off-the-shelf’ or ‘plug- in’ software components Adds more speed or functionality without effecting the operation of the system as a whole Software maintenance becomes easier