OBJECT ORIENTED PROGRAMMING What is Object Oriented Software? Software based on the creation of objects An object is a “black box” which receives and.

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

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.
Classes & Objects Computer Science I Last updated 9/30/10.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Programming Language Paradigms: summary. Object-oriented programming Objects are the fundamental building blocks of a program. Interaction is structured.
Object Oriented System Development with VB .NET
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;
The Object Oriented Programming Languages (OOPL). Done by: Tayeb El Alaoui Supervised by: Dr Driss Kettani.
Object-Oriented Databases
Object-oriented Programming Concepts
ASP.NET Programming with C# and SQL Server First Edition
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
C++ fundamentals.
CSCI-383 Object-Oriented Programming & Design Lecture 15.
Introduction To System Analysis and design
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Comparison of OO Programming Languages © Jason Voegele, 2003.
Programming Languages and Paradigms Object-Oriented Programming.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 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.
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
Introduction to Object-oriented programming and software development Lecture 1.
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
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
Sadegh Aliakbary Sharif University of Technology Fall 2011.
CONCEPTS OF OBJECT ORIENTED PROGRAMMING. Topics To Be Discussed………………………. Objects Classes Data Abstraction and Encapsulation Inheritance Polymorphism.
School of Computer Science & Information Technology G6DICP - Lecture 22 The Theory of Object Oriented Programming.
JavaScript, Fourth Edition
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
 OOPLs  Help companies reduce complexity  Increase competition in open markets  Speeds up development  Improves maintenance, resusability, modifiability.
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
Introduction to Object Oriented Programming CMSC 331.
SNPL1 Woochang Lim What (Variable) + How (Function) = Object Objects are the physical and conceptual things we find in the universe around us. Object-Oriented.
Chapter 12 Support for Object oriented Programming.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
Object-Oriented Programming Chapter Chapter
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Object-Oriented Programming. Objectives Distinguish between object-oriented and procedure-oriented design. Define the terms class and object. Distinguish.
Introduction to OOP CPS235: Introduction.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
A Survey of Object-Oriented Concept Oscar Nierstrasz.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
1 n Object Oriented Programming. 2 Introduction n procedure-oriented programming consists of writing a list of instructions and organizing these instructions.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
ISBN Chapter 12 Support for Object-Oriented Programming.
Object Oriented Programming in Java Habib Rostami Lecture 2.
Object Oriented Programming CMSC 331. Concept of Abstraction “An abstraction is a view or representation of an entity that includes only the attributes.
Chapter 12: Support for Object- Oriented Programming Lecture # 18.
CSCI 383 Object-Oriented Programming & Design Lecture 15 Martin van Bommel.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Visit for more Learning Resources
CHAPTER 5 GENERAL OOP CONCEPTS.
Object-Oriented Database Management System (ODBMS)
OOP What is problem? Solution? OOP
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
C++.
Advanced Programming Behnam Hatami Fall 2017.
Presentation transcript:

OBJECT ORIENTED PROGRAMMING

What is Object Oriented Software? Software based on the creation of objects An object is a “black box” which receives and sends messages A black box contains code and data, which are merged into a single indivisible object As a user - Do not peek into the box!

Why is it so famous? Offers a new and powerful model for writing computer software Improves maintenance, reusability and modifiability Improves principles of modularity and information hiding.

POINTS OF DISCUSSION Object Message Event Class Property Inheritance Data Abstraction and Encapsulation

INTRODUCTION “Object Oriented Programming models real-world objects with software counterparts”, H.M.Deitel & P.J.Deitel It is a type of programming where a programmer defines both data types and functions of a data structure.

What is an Object? OOP encapsulates data and functions into packages called objects, that are intimately tied together. Objects are individual instances of a class.

So, what is a class? It determines everything about an object. Spot is an object created from class Dog. A method is simply the action that a message carries out. The Dog class defines messages that the Dog objects can understand, like “bark” and “fetch”.

Message Messages define the interface to the object All communication to the object is done via the messages Objects do not ordinarily perform their behavior spontaneously, rather a specific behavior is invoked when a message is sent.

PROPERTY AND EVENTS An event is a signal for the object to perform its function Properties are defined characteristics of the object

PROPERTIES Take advantage of class relationships, where objects of a certain class have the same characteristics Provide a more natural and intuitive way of viewing the program’s progress Encapsulate data and functions into objects

INHERITANCE Inheritance is a form of software reusability in which new classes are created from existing classes by the absorption of attributes and behaviors, embellishing these with capabilities the new class requires.

INHERITANCE In any good Object Oriented language, the programmer creates a subclass of the original class. This new class inherits all the existing messages, and therefore, all the behavior of the original class. The original class is called the parent class or Super class, of the new class. A subclass is said to be a specialization of its super class, and conversely, a super class a generalization of its subclass.

INHERITANCE Promotes reuse Programmers don’t start from the scratch when they write a new program. They reuse an existing repertoire of classes that have behaviors similar to what is required in the new program. For example, after creating the class Dog, you might create a subclass called Wolf, which defines some wolf specific messages such as hunt.

INHERITANCE It is more sensible to define a common class called Canine, of which both Dog and Wolf are sub classes Much of the art of OOP is determining the best way to divide a program into an economical set of classes. In addition to speeding development time, proper class construction and reuse results in far fewer lines of code, which translates to less bugs, and lower maintenance costs.

DATA ABSTRACTION Loosely defined category of objects that can be manipulated and used in a variety of different programs.

DATA ENCAPSUALTION Providing access to an object only through its messages, while keeping the details private

A SIMPLE EXAMPLE Suppose, you wanted a data type called list(list of names) Struct list{ }; List a, b, c; a = “Mary Jones”; b = “Suzy Smith”;

A SIMPLE EXAMPLE In C, adding the integers a and b produces an error; the language doesn’t know what to do with a and b because they are not numeric entities. They are strings –

A SIMPLE EXAMPLE a:=List fromString: ‘Mary Jones’. b:=List fromString: ‘Suzy Smith’. C:=a+b. Output: ‘Mary Jones, Suzy Smith’

A SIMPLE EXAMPLE The first two lines of code simply create List objects a and b from the two strings. This now works, because the list class was created with a method which specifically “knows” how to handle the message “+”. Hence, C will have the new value of a combination of the argument with its own object by striking them together with a comma separating them. ‘Mary Jones, Suzy Smith’

OBJECT ORIENTED LANGUAGES There are almost two dozen of them today! The leading commercial OOL’s are: C++ Smalltalk Java C++ is an OO version of C Smalltalk is significantly faster to develop than C++ Java is the latest, flashiest OO language

C++ - OBJECT ORIENTED LANGUAGE C++ is compatible with C (superset of C), so that existing code can be incorporated into C++ programs. C++ programs are fast and efficient, qualities which helped make C an extremely popular programming language. It sacrifices certain flexibility in order to remain efficient

C++ - OBJECT ORIENTED LANGUAGE C++ uses compile-time binding, which means the programmer must specify the specific class of an object, which makes for high run-time efficiency and small code size, but it trades off some of the power to reuse the classes. C++ has become so popular that most new compilers are C/C++ compilers.

C++ - OBJECT ORIENTED LANGUAGE However, in order to take full advantage of OOP, one must program in C++, not C. This often can be a major problem for C programmers. Many programmers think they are coding in C++, but instead are only using a small part of the language’s object oriented power!

Smalltalk - OBJECT ORIENTED LANGUAGE C++ makes some practical compromises to ensure fast execution and small code size, Smalltalk makes none. It uses run-time binding, which means that nothing about the type of an object need be known before a Smalltalk program is run. Smalltalk has a rich class library that can be easily reused via inheritance.

Smalltalk - OBJECT ORIENTED LANGUAGE It also has a dynamic development environment Smalltalk is not explicitly compiled, like C++ It is syntactically very simple, much more so than either C or C++.

Java - OBJECT ORIENTED LANGUAGE Java is designed as a portable language that can run on any web-enabled computer via that computer’s web browser. As such, it offers great promise as the standard internet and intranet programming language. Java is a mixture of C++ and Smalltalk! It has no pointers, low-level programming constructs that make error-prone programs.

Java - OBJECT ORIENTED LANGUAGE Like Smalltalk, Java has garbage collection, a feature that frees the programmer from explicitly allocating and de-allocating memory. It runs on a Smalltalk-style virtual machine, software built into web browser which executes the same standard compiled Java byte codes irrespective of the computer used.

Powerbuilder - OBJECT ORIENTED LANGUAGE PowerBuilder is an object oriented application tool that allows to build powerful, multitier applications to run on multiple platforms and to interact with various databases. Each menu or window you create is an object. Each object contains properties, events and functions.

SUMMARY An object is a bundle of variables and related methods A method is an operation which can modify an object’s behavior. A Class is a blueprint of an object. When defining a Class, you must consider any possible sub class.

CONCLUSION Major advantages of OOP are It can address the problems that increasing size and complexity cause Produce more complete and understandable specifications and designs by using all major types of data abstraction This approach speeds up the development of new programs, improves maintenance and reusability.

CONCLUSION However, OOP requires a major shift in thinking by programmers. The C++ offers an easier transition via C, but it still requires an OO design approach. Java promises much for web-enabling OO programs. Smalltalk offers a pure OO environment.

BIBLIOGRAPHY C++ How to Program - Deitel & Deitel Object Oriented Analysis - David Brown Object Oriented Analysis and Design with applications - Grady Booch What is Object-Oriented Software? An article by Terry Montlick Design, Implementation and Management - Peter Rob Carlos Coronel.