Introduction to Object Oriented Programming Lecture-3.

Slides:



Advertisements
Similar presentations
Object Oriented Programming
Advertisements

4. Object-Oriented Programming Procedural programming Structs and objects Object-oriented programming Concepts and terminology Related keywords.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Informática II Prof. Dr. Gustavo Patiño MJ
Abstraction Lecture-4. ADT example: London Underground Map.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore 20 Object Oriented Theory II.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Chapter 10 Introduction to Objects and Classess 1.
Object-Oriented Analysis and Design
Object-Oriented PHP (1)
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
C++ Training Datascope Lawrence D’Antonio Lecture 4 An Overview of C++: What is a Class/Object?
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.
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
C++ fundamentals.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
OBJECT ORIENTED PROGRAMMING
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
COMPUTER PROGRAMMING. Introduction to C++ History Merges notions from Smalltalk and notions from C The class concept was borrowed from Simular67 Developed.
Introduction To System Analysis and design
UFCEUS-20-2 : Web Programming Lecture 5 : Object Oriented PHP (1)
Object Oriented Programming Development
Introduction to Object-oriented programming and software development Lecture 1.
BCS 2143 Introduction to Object Oriented and Software Development.
School of Computer Science & Information Technology G6DICP - Lecture 22 The Theory of Object Oriented Programming.
Stephenson College DP 96 1 Object-Orientation by Derek Peacock.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
1 What is OO Design? OO Design is a process of invention, where developers create the abstractions necessary to meet the system’s requirements OO Design.
Kal Bugrara, Ph.DSoftware Engineering Northeastern University Fundamentals Of Software Engineering Lecture V.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
Abstraction ADTs, Information Hiding and Encapsulation.
Overview The Basics – Python classes and objects Procedural vs OO Programming Entity modelling Operations / methods Program flow OOP Concepts and user-defined.
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)
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
1 Object Oriented Programming Development z By: Marc Conrad University of Luton z z Room: D104.
S.Ducasse Stéphane Ducasse 1 Essential OO Concepts Stéphane Ducasse.
OOP (Object Oriented Programming) Lecture 1. Why a new paradigm is needed? Complexity Five attributes of complex systems –Frequently, complexity takes.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science)
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.
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Lecture 2 Object-oriented programming. Definitions of OOP OOP is a programming paradigm, which utilizes encapsulation, inheritance and polymorphism. (From.
Copyright 2005, The Ohio State University CSE – Introduction to C++ Name: Shirish Tatikonda Time: T 3:30 PM Room: BE 394
MANAGING COMPLEXITY Lecture OO01 Introduction to Object-oriented Analysis and Design Abstract Data Types.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Object Oriented Paradigm OOP’s. Problems with Structured Programming As programs grow ever larger and more complex, even the structured programming approach.
Structure A Data structure is a collection of variable which can be same or different types. You can refer to a structure as a single variable, and to.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
MAITRAYEE MUKERJI Object Oriented Programming in C++
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.
Object Oriented Programming Development
Object Oriented Programming
Object-Oriented Programming Concepts
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Object-Oriented Analysis and Design
OOP What is problem? Solution? OOP
Review: Two Programming Paradigms
Object Oriented Concepts -I
Lecture 1 Introduction.
Procedural Programming
UNIT I OBJECT ORIENTED PROGRAMMING FUNDAMENTALS
BCA-II Object Oriented Programming using C++
What Is Good Software(Program)?
Object-Oriented PHP (1)
Object-Oriented Programming
Agenda Software development (SD) & Software development methodologies (SDM) Orthogonal views of the software OOSD Methodology Why an Object Orientation?
Presentation transcript:

Introduction to Object Oriented Programming Lecture-3

Programming Techniques Unstructured Programming Procedural Programming Modular Programming Object Oriented Programming

Unstructured Programming The first step into programming Hello World program as seen below However it is difficult to manage a program once the program gets large > 100 lines? #include using namespace std; int main(void) { cout << “Hello World” << endl; return 0; }

Procedural Programming Divide program into smaller blocks of code These may then be called more than once Makes program more structured (and less prone to errors) Allows programs to be designed to show a flow of Data where data is passed from the main program into the procedures

Procedural Programming #include using namespace std; double calculate_new(double); int main(void) { double prices[] = 54,312,78,654,65,18; for(i=0; i<6; i++) { double newprice = calculate_new(price[i]); cout << “New price for item “ << i<< “= “ << newprice <<endl; } return 0; } double calculate_new( double oldprice) { return 0.70*oldprice; }

Modular Programming Procedures of common functionality are grouped into separate modules Each module can have it's own data Each module can maintain an internal state However the module may exist at most once in each program Structure of modular programs dictated by functions not data Programs compiled into different modules so we use a makefile to control the process (or ide based system which manages the project)

Why Object Oriented Programming Previously data effectively global to the program  This leads to errors Increasing size of programs make maintenance difficult (sometimes impossible) Inter / intra project communication problems (teams of developers using different modules to do the same thing) Software re-use

But What is OO (the world as objects) Systems are modelled as sets of interacting objects Proponents claim that Object Orientation  Is intuitive and abstract  Manages Complexity  Aids communication  Scales up to large systems  Allows consistent representation throughout the lifecycle phases

What is an Object A tangible or visible 'thing' e.g. a person 'An object represents an individual identifiable item, unit or entity, either real or abstract, with a well defined role in the problem domain' This is good news for graphics programming as most things we want to design are objects or things that act on objects (e.g. a Shape is an abstract object which can be realised into a more concrete objects such as sphere, cube cone etc.)

Object Structure What Defines an Object ?  A boundary e.g. a car body or building exterior  An internal state e.g. Blood pressure, waiting time  Behavior -- what it does  A Unique identity (as with instances, entities or roles)

Objects have boundaries Physical Boundaries Skin, hull, surface, volume Conceptual Boundaries  'Crisp' well defined e.g. sphere, cube, plane  'fuzzy' e.g. a river, a chemical process, deformation

Objects have states and behaviour State : Static properties - inherit features or characteristics.  e.g. height, volume, width, State: Dynamic values - assigned to a feature  e.g. colour, level of detail, position Behavior is how an object acts and reacts An object may support 'services' that are invoked when a message is sent an object may invoke 'services' in other objects by passing a message to the object

What is an Object color draw() erase() move() getColor() setColor() Identity state behaviour Object Shape

Key OO Concepts There are 4 'pillars' or key concepts to OO these are  Abstraction  Encapsulation  Modularity  Hierarchy

Abstraction Two abstract conceptualisations of a PC  An Intel based processor with peripherals  A box that runs programs “An abstraction denotes the essential characteristics of an object that distinguishes it from all other kinds of objects and thus provides crisply defined conceptual boundaries, relative to the perspective of the viewer”

Encapsulation An Object supports  'Visible' services defined in an interface.  'Hidden' state defined inside the object The state of an object may only be accessed through the services supported in the object interface. However as we shall see when we look at the code we can ignore this (and usually do in graphics programming as we need speed) 'Encapsulation serves to separate the conceptual interface of an abstraction and its implementation '

Modularity An object is a data centred module, with encapsulated state and behavior that operates on that state. Objects communicate through message passing.  This raises the following issues : Deriving objects from the problem domain building 'well-engineered' objects Connecting objects in a meaningful way

Hierarchy Hierarchy is a ranking and ordering of abstractions Two hierarchical schemes in OO :  'Is part of' - the object is a part of a larger object e.g. Engine is part of a car  'Is a' is also known as 'inheritance' we can see this when looking at the hyper- graph in Maya showing how all the different objects in a scene are connected together (especially when using groups).