SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Tiyasi Acharya
Why OOPs?

• Spaghetti code.
• Mass of tangled jumps and conditional
  branches.
• Not designed for efficiency.
Performance




Time/Size




            Complexity
Performance



                         OOPs

Time/Size




            Complexity
How did OOPs come into the picture?




                           Abstraction




‘Emulate the working of a brain’         ‘Abstract out the details’
Internal Model of a Car
Internal Model of a Car




This is what computer scientists tried to bring into OOPs- ABSTRACTION!
Abstraction
Abstraction
This is how the human brain handles the complexity of the world.
Abstraction
This is how the human brain handles the complexity of the world.




                                          How is this achieved in OOPs?
Inheritance
Process by which 1 object acquires the properties of another object.

                      Super Class: Four-wheeler Vehicles
                      Sub Class: Truck, Car, Bus.
Encapsulation
“Hides” incredible amount of complexity by encapsulating it.
Encapsulation
What was it hiding?
Polymorphism
A feature that allows 1 interface to be used for a general class of actions.

                                Steering Wheel




         Power Steering Wheel              Steering wheel of an Electric car
Another example of Polymorphism

           Dog Smell
Class and Objects
OOPs in Objective C
Class and Objects
A class consists of members: data and methods.


                                     Class Name

@interface Employee: NSObject
{
    int empId;
    char *name;                       Members: Data
}

-(int) empId;
                                    Members: Methods
-(int)lengthOfService:date;

@end
Objects



id date=[ [ Date alloc ] init ];     New Date object allocated

[ date release];
                                      Releasing the variable
Inheritance
                                  Superclass Rectangle.m
                                 #import “Rectangle.h”
   Superclass Rectangle.h
                                 @implementation Rectangle
@interface Rectangle: NSObject
{                                -(id) init
    int length;                  {
    int width;                   if(self=[super init])
}                                    {
                                         length = 8;
-(int) area;                             width = 5;
                                     }
@end                                 return self;
                                 }

                                 -(int) area
                                 {
                                     int area1=length * width;
                                 }
                                 @end
Inheritance
Subclass printAreaOfRectangle.h
#import “Rectangle.h”

@interface printAreaOfRectangle: Rectangle

-(void) printVal;

@end




 Subclass printAreaOfRectangle.m
 #import “printAreaOfRectangle.h”

 @implementation printAreaOfRectangle
 (void) printVal
 {
     NSLog(@”Area = %d”,[self area]);
 }
 @end
Encapsulation

• All the data members are ‘Protected’.
• Data is encapsulated, can be accessed only through
  setter/getter methods.
Polymorphism

main
{
    Window *W = [[Window alloc] init];
    View *V = [[view alloc] init];

    [W flush];
    [V flush];
}
Dynamic binding + Message Passing

              main
              {
                  Window *W = [[Window alloc] init];
                  View *V = [[view alloc] init];

                   [W flush];
                   [V flush];

              id anotherObj = W;                           Dynamic Binding

              [anotherObj flush];                            Message Passing
              }




The flush message is passed to the variable anotherObj that is dynamically bound during runtime.
Summary
The OOPs features that Objective C exhibits are as follows:


  •   Abstraction
  •   Encapsulation
  •   Class
  •   Object
  •   Inheritance
  •   Polymorphism
  •   Message passing
  •   Dynamic Binding
Thank you

Weitere ähnliche Inhalte

Was ist angesagt?

Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
Alok Kumar
 

Was ist angesagt? (20)

Java oops PPT
Java oops PPTJava oops PPT
Java oops PPT
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
Object Oriented Concept
Object Oriented ConceptObject Oriented Concept
Object Oriented Concept
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
 
OOPS in Java
OOPS in JavaOOPS in Java
OOPS in Java
 
OOPs in Java
OOPs in JavaOOPs in Java
OOPs in Java
 
Basic Concepts Of OOPS/OOPS in Java,C++
Basic Concepts Of OOPS/OOPS in Java,C++Basic Concepts Of OOPS/OOPS in Java,C++
Basic Concepts Of OOPS/OOPS in Java,C++
 
Oops concept on c#
Oops concept on c#Oops concept on c#
Oops concept on c#
 
C++ classes
C++ classesC++ classes
C++ classes
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
 
Oops Concept Java
Oops Concept JavaOops Concept Java
Oops Concept Java
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
 
Oops in java
Oops in javaOops in java
Oops in java
 
Oop
OopOop
Oop
 
Oo ps concepts in c++
Oo ps concepts in c++Oo ps concepts in c++
Oo ps concepts in c++
 
Java oops and fundamentals
Java oops and fundamentalsJava oops and fundamentals
Java oops and fundamentals
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
 
Oop java
Oop javaOop java
Oop java
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
 
Oop concepts classes_objects
Oop concepts classes_objectsOop concepts classes_objects
Oop concepts classes_objects
 

Andere mochten auch

iOS Application Lifecycle
iOS Application LifecycleiOS Application Lifecycle
iOS Application Lifecycle
Siva Prasad K V
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
thinkphp
 
Project object explain your choice
Project object   explain your choiceProject object   explain your choice
Project object explain your choice
Soren
 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)
Jay Patel
 
Introduction to xcode
Introduction to xcodeIntroduction to xcode
Introduction to xcode
Sunny Shaikh
 

Andere mochten auch (20)

OOP Chapter 8 : Inheritance
OOP Chapter 8 : InheritanceOOP Chapter 8 : Inheritance
OOP Chapter 8 : Inheritance
 
iOS Application Lifecycle
iOS Application LifecycleiOS Application Lifecycle
iOS Application Lifecycle
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Oops ppt
Oops pptOops ppt
Oops ppt
 
Cv Thomas Faradta
Cv Thomas FaradtaCv Thomas Faradta
Cv Thomas Faradta
 
Oops and c fundamentals
Oops and c fundamentals Oops and c fundamentals
Oops and c fundamentals
 
Project object explain your choice
Project object   explain your choiceProject object   explain your choice
Project object explain your choice
 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
 
OOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOPOOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOP
 
Introduction to xcode
Introduction to xcodeIntroduction to xcode
Introduction to xcode
 
Objective c slide I
Objective c slide IObjective c slide I
Objective c slide I
 
Characteristics of OOPS
Characteristics of OOPS Characteristics of OOPS
Characteristics of OOPS
 
iOS Developer Interview Questions
iOS Developer Interview QuestionsiOS Developer Interview Questions
iOS Developer Interview Questions
 
Core java lessons
Core java lessonsCore java lessons
Core java lessons
 
LIDO勉強会#1
LIDO勉強会#1LIDO勉強会#1
LIDO勉強会#1
 
describing objects
describing objectsdescribing objects
describing objects
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
Describing objects
Describing objectsDescribing objects
Describing objects
 
Intro to C++ - language
Intro to C++ - languageIntro to C++ - language
Intro to C++ - language
 

Ähnlich wie OOPS features using Objective C

Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programming
Abzetdin Adamov
 
Presentation 4th
Presentation 4thPresentation 4th
Presentation 4th
Connex
 
1207028 634528828886611250
1207028 6345288288866112501207028 634528828886611250
1207028 634528828886611250
Akhil Nama
 

Ähnlich wie OOPS features using Objective C (20)

Iphone course 1
Iphone course 1Iphone course 1
Iphone course 1
 
iOS Basic
iOS BasiciOS Basic
iOS Basic
 
обзор Python
обзор Pythonобзор Python
обзор Python
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
 
Objective c
Objective cObjective c
Objective c
 
Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programming
 
Java For Automation
Java   For AutomationJava   For Automation
Java For Automation
 
Java
JavaJava
Java
 
Java Tutorial
Java Tutorial Java Tutorial
Java Tutorial
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
 
Awesomeness of JavaScript…almost
Awesomeness of JavaScript…almostAwesomeness of JavaScript…almost
Awesomeness of JavaScript…almost
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
Presentation 4th
Presentation 4thPresentation 4th
Presentation 4th
 
C# for Java Developers
C# for Java DevelopersC# for Java Developers
C# for Java Developers
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introduction
 
Bc0037
Bc0037Bc0037
Bc0037
 
From C++ to Objective-C
From C++ to Objective-CFrom C++ to Objective-C
From C++ to Objective-C
 
Objective-C for iOS Application Development
Objective-C for iOS Application DevelopmentObjective-C for iOS Application Development
Objective-C for iOS Application Development
 
1207028 634528828886611250
1207028 6345288288866112501207028 634528828886611250
1207028 634528828886611250
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

OOPS features using Objective C