[oop - lec 01] introduction to oop

12
Introduction Muhammad Hammad Waseem [email protected]

Upload: muhammad-hammad-waseem

Post on 06-Apr-2017

129 views

Category:

Education


5 download

TRANSCRIPT

Page 1: [OOP - Lec 01] Introduction to OOP

IntroductionMuhammad Hammad [email protected]

Page 2: [OOP - Lec 01] Introduction to OOP

Course Objective• The course aims to focus on object-oriented concepts, analysis and

software development.• This course provides in-depth coverage of object-oriented

programming principles and techniques using C++, Understanding and fundamentals (principles) of object oriented programming: encapsulation, polymorphism, and inheritance.• Strong skills in Object Oriented programming will help students to

boost their skills towards software development

Page 3: [OOP - Lec 01] Introduction to OOP

Course Outline (1/2)• Introduction to Object Oriented Programming, History, Why Object

Oriented Programming, Programming Paradigms.• Basic Building Blocks of Object Oriented Programming (classes and

objects), Data Members, Member Functions, Accessing class members, Classes and structures.• OOP Key Features (Data Encapsulation and Data Hiding (in detail),

overview of Inheritance and , Polymorphism).• Access Specifiers,• Constructors, (Characteristics, Usage, Syntax), Types of Constructors,

Destructors, Member Functions definition outside the class construct,

Page 4: [OOP - Lec 01] Introduction to OOP

Course Outline (2/2)• Scope resolution operator, Returning values and objects from member

functions, Passing objects as arguments,• Static class data (characteristics, usage, syntax),Static Member functions,• Const Members,• Function and Operator Overloading,• Interfaces, Classes and interfaces,• Virtual functions, Inheritance (Characteristics, Usage, Base classes, Derived

classes), Types of Inheritance,• Polymorphism, I/O and file processing,• Exception handling, STL.

Page 5: [OOP - Lec 01] Introduction to OOP

Course Material• Main Material Will be Available through Slides and Notes• Reference Books: • Object Oriented Programming in C++, Fourth Edition By RoberLafore,• C How to Program, Sixth Edition Dietal & Dietal

• Recommended for Practice and Understanding• Object Oriented Programming in C++, IT Series

Page 6: [OOP - Lec 01] Introduction to OOP

Background knowledge• It is expected that you have experience of writing and understanding

programs with C.• It is also expected that students will have the knowledge of • Functions, • Structures and • Pointers.

Page 7: [OOP - Lec 01] Introduction to OOP

How to get the goals• Read and Remember• Read the books, remember the language

• Think• Think in objects, think in classes

• Practice • Do as many coding as possible and make them running

• Ask• Questions

Page 8: [OOP - Lec 01] Introduction to OOP

Programming• Programming is like writing, If you can write a demonstration, you can

make a program. • But, actually, programming is not so easy, because a real good

program is not easily programmed. • It needs the programmers’ lots of wisdom, lots of knowledge about

programming and lots of experience.• It is like writing, to be a good writer needs lots of experience and lots

of knowledge about the world.• Learning and practice are necessary.

Page 9: [OOP - Lec 01] Introduction to OOP

Computer Programming• Computer Programming is the process of planning a sequence of

steps (called instructions) for a computer to follow.• Programming is a process of problem solving.• Programming life cycle consist of three main phases.• Analyze the problem• Implement the algorithm• Maintenance

Page 10: [OOP - Lec 01] Introduction to OOP

Computer Programming• Problem-Solving Phase

• Analysis and Specification: Understand (define) the problem and what the solution must do.

• Understand problem requirements • Does program require user interaction?• Does program manipulate data? • What is the output?• If the problem is complex, divide it into sub problems

• Analyze each sub problem as above• General Solution (Algorithm): Specify the required data types and the logical sequences

of steps that solve the problem.• Verify: Follow the steps exactly to see if the solution really does solve the problem.

Page 11: [OOP - Lec 01] Introduction to OOP

Computer Programming• Implementation Phase

• Concrete Solution (Program): Translate the algorithm (the general solution) into a programming language.

• Test: Have the computer follow the instructions. Then manually check the results. If you find errors, analyze the program and the algorithm to determine the source of the errors, and then make corrections.

• Maintenance Phase• Modify the program to meet changing requirements or to correct any errors that show

up while using it.

Page 12: [OOP - Lec 01] Introduction to OOP

Object Oriented Programming (OOP)• OOP is a technique in which programs are written on the basis of objects. • An object is collection of data and functions.• The fundamental idea behind object oriented programming is to combine

both data and functions into a single unit. Such a unit is called object.• Object is derived from abstract data type.• Objects of a program interact by sending messages to each other.• Object-oriented programming has a web of interacting objects, each

house-keeping its own state.• OOP is based on real world modeling.