Sie sind auf Seite 1von 16

Object Oriented Programming

Introduction to
Object Oriented design
Prepared By
Mehak Usmani

1
Objectives
• To know about the history of Computer Programming
• To understand different categories of Programming Languages
• To understand Code Compilation
• To understand Procedural Programming
• To understand the basic of OOP
• To learn the motivation for Object Oriented Approach
• To be able to differentiate OO Approach from Procedural
• To know the Pillars of OOP

2
Computer Programming
• Computer Program is a set of instructions to the computer.
• Managed program as per user requirements is known as software.
• Computers do not understand human languages, so you need to use
computer languages to communicate with them.
• Programming languages.
• Each language has a unique set of keywords and a special syntax for
organizing program instructions.

3
Categories of Programming Languages
• Machine Language
• Assembly Language
• High Level Languages

4
Machine Language
• Machine language is a set of primitive instructions built into every
computer.
• Each different type of CPU has its own unique machine language.
• The instructions are in the form of binary code.

1101101010011010

5
Assembly Language
• Lying between machine languages and high-level languages
• Much easier to program in because of mnemonics.
• Low-level language & machine dependent
• Assembler is required
ADD AH, BH

6
High-level Languages
• Closer to human languages.
• Independent of type of machine.
• Easy to learn and program.
• Platform Independent.

area = 5 * 5 * 3.1415;

• Deal with variables, arrays, objects, complex arithmetic, functions, loops,


locks, and other abstract computer science concepts.

7
Popular High-Level Languages
• COBOL (COmmon Business Oriented Language)
• FORTRAN (FORmula TRANslation)
• BASIC (Beginner All-purpose Symbolic Instructional Code)
• Pascal (named for Blaise Pascal)
• C (C combines the power of an assembly language with the ease of use
and portability of a high-level language.)
• Visual Basic (Basic-like visual language developed by Microsoft)
• C++ (an object-oriented language, based on C)
• Java (used for developing platform-independent Internet applications)
• C# (a Java-like language developed by Microsoft)

8
Code Compilation
• The translation can be done using programming tool called
– an Interpreter or
– a compiler.
• Object program
• Linking before execution.

9
Interpreter & compiler

10
Procedural Programming
• Traditional programming
• Procedural programming uses a list of instructions to tell the computer
what to do step-by-step.
• Relies on procedures, also known as routines or subroutines.
• Intuitive
• Detailed & Simple
• Not suitable for highly complex problems
• Repetitive
• Examples: Fortran, COBOL and C

11
Procedural Programming

12
Object Oriented Programming
• OOP is a programming language model organized around objects rather
than "actions" and data rather than logic.
• Steps:
1. Identify all the objects
2. Generalized as a class of objects
• Software development and maintenance simplified
• Object, Class, Inheritance, data binding, polymorphism etc.
• Smalltalk

13
Motivation for Object Oriented Approach
• Code Reusability
• Abstraction
• Reduced maintenance
• Quick & Efficient
• Reliability
• Flexibility
• Real world Modeling

14
Difference between Procedural and OO Approach
• Easy development and maintenance of software using OOP
• PP relies on procedures that operate on data while OOP bundles these
two concepts into objects.
• OO based programs are complex.
• OOP requires less code.
• OOP is quick to build programs.

15
Pillars of OOP

1. Abstraction
2. Inheritance
3. Polymorphism
4. Encapsulation

16

Das könnte Ihnen auch gefallen