1 CIS601: Object-Oriented Programming in C++ Note: CIS 601 notes were originally developed by H. Zhu for NJIT DL Program. The notes were subsequently revised.

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

Data Structures.
4. Object-Oriented Programming Procedural programming Structs and objects Object-oriented programming Concepts and terminology Related keywords.
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
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Classes & Objects Computer Science I Last updated 9/30/10.
COSC2767: Object-Oriented Programming
Object-Oriented Analysis and Design
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
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.
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.
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
BACS 287 Basics of Object-Oriented Programming 1.
Introduction To System Analysis and design
Copyright © 2002, Systems and Computer Engineering, Carleton University Intro.ppt * Object-Oriented Software Development Unit 1 Course.
Object Oriented Programming Development
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.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
Welcome to OBJECT ORIENTED PROGRAMMIN Date: 10/09/2014 Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
An Object-Oriented Approach to Programming Logic and Design
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
Unified Modeling Language, Version 2.0
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
11 1 Chapter 11 Object Oriented Databases Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
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.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
Object-Oriented Programming with Java Lecture 1: Introduction Autumn, 2007.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
Learners Support Publications Object Oriented Programming.
Abstraction ADTs, Information Hiding and Encapsulation.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Introduction to Object Orientation Dr. Ahmed Youssef.
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.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Methodology First and Language Second -A Way to Teach Object-Oriented Programming Haibin Zhu, PhD Department of Computer Science and Mathematics Nipissing.
Object-Oriented Programming © 2013 Goodrich, Tamassia, Goldwasser1Object-Oriented Programming.
S.Ducasse Stéphane Ducasse 1 Essential OO Concepts Stéphane Ducasse.
1 Unified Modeling Language, Version 2.0 Chapter 2.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science)
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
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.
Basic Characteristics of Object-Oriented Systems
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.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Object Oriented Programming
Systems Analysis and Design With UML 2
OOP What is problem? Solution? OOP
Systems Analysis and Design With UML 2
Object-Orientated Programming
CIS601: Object-Oriented Programming in C++
CSE Object Oriented Programing
Object-Oriented Programming
Presentation transcript:

1 CIS601: Object-Oriented Programming in C++ Note: CIS 601 notes were originally developed by H. Zhu for NJIT DL Program. The notes were subsequently revised by M. Deek. Lesson #1

2 Contact Information Web:

3 Goals for the Course u To understand Object Oriented programming u To further develop your C++ skills

4 Course Coverage u Fundamentals of object-oriented programming *Data abstraction *Encapsulation *Inheritance *Dynamic binding *Polymorphism

5 u C++ will be used as a vehicle to illustrate and implement OOP concepts. u Object-oriented paradigm will be applied to design and programming. Course Coverage cont.

6 u Effects of OO methodology on software design u maintenance u extensibility u reusability Course Coverage cont.

7 Prerequisites u Working knowledge of u C/C++ u Familiarity with operating systems u Familiarity with compilers

8 Lectures u 1. Introduction to Object-Oriented Programming u 2. Overview of basic structures of C++ u 3. Objects and Classes u 4. Objects and Classes in C++ u 5. Inheritance u 6. Inheritance in C++ u 7. Polymorphism and That in C++

9 Lectures cont. u 8. Operator Overloading in C++ u 9. Templates and Friends in C++ u 10. I/O Streams in C++ u 11. Exception Handling in C++ u 12. Container Classes in C++ u 13. Object-Oriented Analysis and Design u 14. Case Studies and Review

10 Thinking Methodology u Induction u From specialization to generalization u to create the word “dog” from different dogs Dog

11 Thinking Methodology u Deduction(infer) u From generalization to specialization u From the word “dog” you have learned that an animal is or is not a dog. DOG

12 Design Methodologies u Functional decomposition (Top-Down) u The whole system is characterized by a single function, and then the function is decomposed into a set of functions in a process of stepwise refinement.

13 Functional decomposition The System Function1Function2Function3 Function11Function12... Studying DeskTable topFiling cabinetBookshelves Left drawerMiddle drawerRight drawer

14 Design Methodologies u Functional composition (bottom-up) u To create different components of a function from a library of functions. u To integrate components into a module and form a more significant function.

15 Functional composition The System Function1Function2Function3 Function11Function12... Studying DeskTable topFiling cabinetBookshelves Left drawerMiddle drawerRight drawer

16 Functional (De)Composition u Modules with well-defined semantics that can be directly implemented. u Procedures own the data. u Data plays a secondary role. u Does not necessarily reflect the states of abstraction in the application.

17 Object-Orientation u A thinking methodology u Everything is an object. u Any system is composed of objects (a system is also an object). u The evolution and development of a system is caused by the interactions of the objects inside/outside a system.

18 Everything is an object u A student, a professor u A desk, a chair, a classroom, a building u A university, a city, a country u The world, the universe u A subject such as CS, IS, Math, History, …

19 Systems are composed of objects u An educational system u An economic system u An information system u A computer system

20 The development of a system is caused by interactions u NJIT is defined by the interactions among: u students u professors u staff u Board governance u State governance u …... Inside NJIT Outside NJIT

21 Design Methodologies u Object-Orientation is a design methodology(OOA/OOD) u Objects are the building blocks of a program (interface, editor, menu, file, etc.); data managing object (db), etc.) u Objects represent real-world abstractions within an application.

22 Design Methodologies u Object-orientation supports u induction: objects -> a class u This needs tools u and deduction: a class ->objects u This needs programmers

23 Design Methodologies u Object-orientation supports u Top-down: from a super-class to sub- classes u Bottom-up: from sub-classes to a super-class

24 Programming Techniques u The evolution of programming techniques is u to make languages more expressive u to control complex systems more easily

25 Abstract Data Types(ADTs) u Abstraction u Properties u Abstract Data Types and Object- Orientation

26 Abstraction u to understand a problem by separating necessary from unnecessary details u To define the interface to a data abstraction without specifying implementation detail.

27 Problem Model Abstraction

28 Properties of ADT u With abstraction, you create a well- defined entity u These entities define the data structure as a set of items. u For example, each employee has a name, date of birth, and social number...

29 Properties of ADT( Cont.) u The data structure can only be accessed with defined operations. u This set of operations is called the interface u An entity with these properties is called an abstract data type (ADT).

30 Interface Operations Abstract Data Structure Abstract Data Type ADT

31 Definition (ADT) u ADT is characterized by the following properties: u 1. It exports a type. u 2. It exports a set of operations. u 3. Operations of the interface are the only access mechanism to the data structure. u 4. Axioms and preconditions define the application domain of the type.

32 Example: ADT List u Type List. u The interface to instances of type List is defined by the interface definition file. u Operations: insert, get, append, delete, search,…

33 List u The application domain is defined by the semantical meaning of the provided operations. Axioms and preconditions include statements such as u ``An empty list is a list.'' u ``Let l=(d1, d2, d3,..., dN) be a list. Then l.append(dM) results in l=(d1, d2, d3,..., dN, dM).'' u ``an element of a list can only be deleted if the list is not empty.''

34 Encapsulation u Combines the data and the operations u Encloses both variables and functions u Keeps details of data and operations from the users of the ADT

35 Encapsulation (cont.) u Allows for modularity u Controls access to data u Separates implementation from interface u Extends the built-in types

36 Object-Oriented Programming u Objects are derived from ADTs. u Interacting objects handle their own house-keeping. u Objects in a program interact by sending messages to each other.

37 Object 1 Data 1 +Procedures 1 DataData 1 Object 3 Data 3 + Procedures 3 Object 2 Data 2 + Procedures 2 Object 4 Data 4 + Procedures 4

38 Object-Oriented Programming u Each object is responsible to initialize and destroy itself. u Therefore, there is no need to explicitly call a creation or termination procedure.

39 ADT and Object-Orientation u ADTs allow for the creation of instances with well-defined properties and behavior. u In object-orientation, ADTs are referred to as classes. u Therefore, a class defines the properties of objects called instances.

40 ADT and Object-Orientation u ADTs define functionality by emphasizing the involved data, their structure, operations, axioms and preconditions. u Object-oriented programming is ``programming with ADTs'': combining functionality of different ADTs to solve a problem. u Therefore, instances (objects) of ADTs (classes) are dynamically created, destroyed and used.

41 Inheritance(Hierarchy) u Expresses commonality among objects u Allows code reusability u Highlights Generalization/Specialization relationships

42 Polymorphism u The ability of objects to respond differently to the same message or function call.

43 u Modules u Information hiding u Data encapsulation u Abstract data types u Objects Object-Orientation Evolution

44 Remember: u Encapsulation (Data & Operations)-- A technique for Information Hiding. The users of the objects do not need to know the details of the data and operations of the objects. u Data Abstraction -- the procedure to define a class from objects. u Abstract Data Type-- Class.

45 u Object view u Makes systems more understandable u Unifies design and programming methods u Initial program thoughts are informal objects-and-interactions, even when using non-OO languages. Objects and Large Software Systems

46 Objects and Large Software Systems u Divides code into logical chunks u Allows for "off-the-shelf" code libraries to be reused u Supports code evolution: internals can always be re-written as long as interface stays the same

47 Reading u Chapter 1 Sections u Chapter 5 Sections