CIS601: Object-Oriented Programming in C++

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.
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.
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.
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.
COSC2767: Object-Oriented Programming
OBJECT ORIENTED ANALYSIS & DESIGN Vassilka Kirova Department of Computer & Information Science NJIT.
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.
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.
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.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
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
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.
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.
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)
Data Structures Using C++ 2E
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
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.
1 Unified Modeling Language, Version 2.0 Chapter 2.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science)
Copyright 2006 Oxford Consulting, Ltd1 January Introduction to C++ Programming is taking A problem Find the area of a rectangle A set of data.
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
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.
CSE202 Object Oriented Programing
Programming paradigms
Object Oriented Programming
Sachin Malhotra Saurabh Choudhary
CHAPTER 5 GENERAL OOP CONCEPTS.
Object-Oriented Analysis and Design
Systems Analysis and Design With UML 2
Programming in Java Sachin Malhotra, Chairperson, PGDM-IT, IMS Ghaziabad Saurabh Chaudhary, Dean, Academics, IMS Ghaziabad.
Object-Oriented Database Management System (ODBMS)
OOP What is problem? Solution? OOP
Systems Analysis and Design With UML 2
About the Presentations
Object-Orientated Programming
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
TIM 58 Chapter 8: Class and Method Design
Lecture 1 Introduction.
CSE Object Oriented Programing
What Is Good Software(Program)?
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Object-Oriented Programming
Agenda Software development (SD) & Software development methodologies (SDM) Orthogonal views of the software OOSD Methodology Why an Object Orientation?
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Presentation transcript:

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

Contact Information Email: maura.a.deek@njit.edu Web: www.ccs.njit.edu/maura

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

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

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

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

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

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

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

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

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

Design Methodologies Functional decomposition (Top-Down) 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.

Functional decomposition The System Studying Function1 Function2 Function3 . . . . . . Desk Table top Filing cabinet Bookshelves . . . . . . . . . . . . Function11 Function12 Left drawer Middle drawer Right drawer

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

Functional composition The System Studying Function1 Function2 Function3 . . . . . . Desk Table top Filing cabinet Bookshelves . . . . . . . . . . . . Function11 Function12 Left drawer Middle drawer Right drawer

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

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

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

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

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

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

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

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

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

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

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

Abstraction Problem Model

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

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

Abstract Data Type ADT Abstract Data Structure Interface Operations

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

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

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

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

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

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

Object1 Data1+Procedures1 Object2 Data2 + Procedures2 Data Data1 Object3 Data3 + Procedures3 Object4 Data4 + Procedures4

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

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

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

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

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

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

Remember: 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. Data Abstraction -- the procedure to define a class from objects. Abstract Data Type-- Class.

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

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

Reading Chapter 1 Sections 1.1-1.2 Chapter 5 Sections 5.1-5.2