SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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

Mais procurados (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
 

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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 ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

OOPS features using Objective C