CSC241 Object-Oriented Programming (OOP) Lecture No. 1.

Slides:



Advertisements
Similar presentations
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Advertisements

COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Introduction To System Analysis and Design
Object Oriented System Development with VB .NET
Objects First with Java A Practical Introduction using BlueJ
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
1 Basic Object Oriented Concepts Overview l What is Object-Orientation about? l What is an Object? l What is a Class? l Constructing Objects from Classes.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Object-oriented concepts.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Object-oriented Programming Concepts
03/12/2001 © Bennett, McRobb and Farmer What Is Object-Orientation? Based on Chapter 4 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
CO320 Introduction to Object- Oriented Programming Michael Kölling 3.0.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
C++ fundamentals.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
CSC238 INTRODUCTION TO OOP Chapter 1.
CSC241: Object Oriented Programming
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.
Introduction to Object-oriented programming and software development Lecture 1.
Object Oriented Programming Lecturer: Andreas P. Adi
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
CS212: Object Oriented Analysis and Design Lecture 1: Introduction.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
What Is Object-Orientation?
Introduction To System Analysis and Design
Downloaded From:  Objective of this course is to make students familiar with the concepts of object-oriented programming  Concepts.
Object-Oriented Programming (OOP) CSC-2071 (3+1=4 Credits) Lecture No. 1 MBY.
1 Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill Chapter 2: Object Basics Object-Oriented Systems Development Using the Unified Modeling.
Object Oriented Programming Principles Lecturer: Kalamullah Ramli Electrical Engineering Dept. University of Indonesia Session-3.
OOP Class Lawrence D’Antonio Lecture 3 An Overview of C++
SNPL1 Woochang Lim What (Variable) + How (Function) = Object Objects are the physical and conceptual things we find in the universe around us. Object-Oriented.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
1 CMIS301 O-O Thinking Understanding O-O Programming by T Budd.
Salman Marvasti Sharif University of Technology Winter 2015.
Object-Oriented Programming (OOP) Lecture No. 2. Information Hiding ► Information is stored within the object ► It is hidden from the outside world ►
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Object-Oriented Programming (OOP) Lecture No. 3 Downloaded From:
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
Chapter 11 An introduction to object-oriented design.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Java How to Program, 9/e Presented by: José M. Reyes Álamo © by Pearson Education, Inc. All Rights Reserved.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
CSC241 Object-Oriented Programming (OOP) Lecture No. 2.
Object-Oriented Paradigm (OOP) Course Code: SE 101 Lecture No. 1.
Object Oriented Paradigm OOP’s. Problems with Structured Programming As programs grow ever larger and more complex, even the structured programming approach.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Object-Oriented Programming (OOP) Lecture No. 1. Course Objective ► Objective of this course is to make students familiar with the concepts of object-oriented.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Object-Oriented Programming (OOP) Lecture No. 1
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Object-Oriented Programming (OOP) Lecture No. 2
Object-Oriented Programming
Object-Oriented Programming
Introduction to Visual Basic and Object Oriented Programming
Object-Oriented Programming
WELCOME TO ALL STUDENTS IN MY CLASS: Hope You All Enjoyed C#
Agenda Software development (SD) & Software development methodologies (SDM) Orthogonal views of the software OOSD Methodology Why an Object Orientation?
Presentation transcript:

CSC241 Object-Oriented Programming (OOP) Lecture No. 1

Who Am I?  My name is Saif Ullah Ijaz  MS – Information & Communications Engineering University of Leicester, UK (2011)  BS – Computer Engineering CIIT, Islamabad (2008)  Field of Interest: Web Programming,Software Engineering, Embedded Systems 2

Course Objective  Objective of this course is to make students familiar with the concepts of object-oriented programming  Concepts will be reinforced by their implementation in C++

Course Contents  Object-Orientation  Objects and Classes  Overloading  Inheritance  Polymorphism  Generic Programming  Exception Handling  Introduction to Design Patterns

Course Literature C++ How to Program By Deitel & Deitel, 8 th ed.  The C++ Programming Language By Bjarne Stroustrup, 3 rd ed.  Object-Oriented Software Engineering By Jacobson, Christerson, Jonsson, Overgaard Textbook: Reference book:

Grading Policy TheoryLAB Quizzes15% Assignments10% 1 st sessional10% 2 nd sessional15% Terminal Exam50% Lab Assignments25% 1 st Lab sessional10% 2 nd Lab sessional15% Terminal Lab Exam50%

Object-Orientation (OO)

What is Object-Orientation?  A technique for system modeling  OO model consists of several interacting objects

What is a Model?  A model is an abstraction of something  Purpose is to understand the product before developing it

Examples – Model  Highway maps  Architectural models  Mechanical models

Example – OO Model

…Example – OO Model  Objects  Ali  House  Car  Tree  Interactions  Ali lives in the house  Ali drives the car Ali Car House Tree lives-in drives

Object-Orientation - Advantages  People think in terms of objects  OO models map to reality  Therefore, OO models are  easy to develop  easy to understand

What is an Object? An object is  Something tangible (Ali, Car)  Something that can be apprehended intellectually (Time, Date)

… What is an Object? An object has  State (attributes)  Well-defined behaviour (operations)  Unique identity

Example – Ali is a Tangible Object  State (attributes)  Name  Age  behaviour (operations)  Walks  Eats  Identity  His name

Example – Car is a Tangible Object  State (attributes) - Color - Model  behaviour (operations) - Accelerate- Start Car - Change Gear  Identity - Its registration number

Example – Time is an Object Apprehended Intellectually  State (attributes) - Hours- Seconds - Minutes  behaviour (operations) - Set Hours- Set Seconds - Set Minutes  Identity - Would have a unique ID in the model

Example – Date is an Object Apprehended Intellectually  State (attributes) - Year- Day - Month  behaviour (operations) - Set Year- Set Day - Set Month  Identity - Would have a unique ID in the model

Information Hiding  Information is stored within the object  It is hidden from the outside world  It can only be manipulated by the object itself

Example – Information Hiding  Ali’s name is stored within his brain  We can’t access his name directly  Rather we can ask him to tell his name

Example – Information Hiding  A phone stores several phone numbers  We can’t read the numbers directly from the SIM card  Rather phone-set reads this information for us

Information Hiding Advantages  Simplifies the model by hiding implementation details  It is a barrier against change propagation

Encapsulation  Data and behaviour are tightly coupled inside an object  Both the information structure and implementation details of its operations are hidden from the outer world

Example – Encapsulation  Ali stores his personal information and knows how to translate it to the desired language  We don’t know  How the data is stored  How Ali translates this information

Example – Encapsulation  A Phone stores phone numbers in digital format and knows how to convert it into human-readable characters  We don’t know  How the data is stored  How it is converted to human-readable characters

Encapsulation – Advantages  Simplicity and clarity  Low complexity  Better understanding

Object has an Interface  An object encapsulates data and behaviour  So how objects interact with each other?  Each object provides an interface (operations)  Other objects communicate through this interface

Example – Interface of a Car  Steer Wheels  Accelerate  Change Gear  Apply Brakes  Turn Lights On/Off

Example – Interface of a Phone  Input Number  Place Call  Disconnect Call  Add number to address book  Remove number  Update number

Implementation  Provides services offered by the object interface  This includes  Data structures to hold object state  Functionality that provides required services

Example – Implementation of Gear Box  Data Structure  Mechanical structure of gear box  Functionality  Mechanism to change gear

Example – Implementation of Address Book in a Phone  Data Structure  SIM card  Functionality  Read/write circuitry

Separation of Interface & Implementation  Means change in implementation does not effect object interface  This is achieved via principles of information hiding and encapsulation

Example – Separation of Interface & Implementation  A driver can drive a car independent of engine type (petrol, diesel)  Because interface does not change with the implementation

Example – Separation of Interface & Implementation  A driver can apply brakes independent of brakes type (simple, disk)  Again, reason is the same interface

Advantages of Separation  Users need not to worry about a change until the interface is same  Low Complexity  Direct access to information structure of an object can produce errors

Messages  Objects communicate through messages  They send messages (stimuli) by invoking appropriate operations on the target object  The number and kind of messages that can be sent to an object depends upon its interface

Examples – Messages  A Person sends message (stimulus) “stop” to a Car by applying brakes  A Person sends message “place call” to a Phone by pressing appropriate button