SlideShare una empresa de Scribd logo
1 de 18
OOP Programming
Melick R. Baranasooriya
melick-rajee.blogspot.com
Principles of OOP

        Abstraction            Inheritance



Encapsulation   Polymorphism

                                             2
Inheritance

                         Staff

             Member      Gold
Loyalty
              Non
                        Regular
             Member
                                  3
Classes and Interfaces

              Classes                   Interfaces


                                          methods and
                      Methods contain
Fields, properties,                     properties, left to
                         code for
     methods                            be implemented        4
                        execution
                                              later
5
Inheritance

characteristics of existing   Attributes
      parent class            Operations

extend the      Add new
                              Redefine
  parent       fields and
                              methods
   class        methods                    6
Extensibility
      Inheritance
                         Reusability


        inherits         Provides
                         abstraction


                         Eliminates
implements     Extends   redundant
                         code            7
8
Accessibility Levels

protected internal -                   limited   Private -
to the current assembly or types derived from    restricted to the
             the containing class                containing type




Protected -                                       Public –
limited to the
                         Internal -
containing type and     limited to the current       access is not
                              assembly                               9
types derived from it                                 restricted
Important Aspects

Instance and static constructors        No multiple
       are not inherited                inheritance



Multiple                                Transitive relation
                    Structures cannot
interfaces can be                         C < - B , B < -A
                       be inherited
implemented                                 then C <-A        10
Demo

                                        Virtual +
                Sealed
                                        Override



                          Multiple
Methods + New                         Access Modifiers
                         Interfaces                      11
Abstraction – Reducing the
         complexity

    Classes defined with the       Class +
      keyword abstract             Interface


                 Not implemented
Implemented or
                   methods are        Cannot be
fully
                     declared        instantiated
unimplemented                                       12
                    abstract
13
Encapsulation

   Hides the implementation           Public
            details                 interface



                                   No interface
All data members   Accessed via
                                  members should
should be hidden    properties
                                    be hidden      14
Encapsulation ..

                                      Constructors
         Private data fields
                                      and Assessors


                                         Reduces
Changing the                            complexity
                      Change fields
class internals
                       validation         Easier
does not affect                                       15
                                       maintenance
Polymorphism        Extensibility
Cohesion and Coupling
                        Reusability


  Having many forms     Provides
                        abstraction


 Virtual     Override   Eliminates
Keyword      Keyword    redundant
                        code            16
17
THANK YOU!   18

Más contenido relacionado

Destacado (20)

General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
 
Threading
ThreadingThreading
Threading
 
JSOM and java script practices
JSOM and java script practicesJSOM and java script practices
JSOM and java script practices
 
App deployment
App deploymentApp deployment
App deployment
 
General oops concepts
General oops conceptsGeneral oops concepts
General oops concepts
 
General OOP Concepts
General OOP ConceptsGeneral OOP Concepts
General OOP Concepts
 
Object oreinted php | OOPs
Object oreinted php | OOPsObject oreinted php | OOPs
Object oreinted php | OOPs
 
Beginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHPBeginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHP
 
Parameterized Constructor
Parameterized ConstructorParameterized Constructor
Parameterized Constructor
 
Oops
OopsOops
Oops
 
03. oop concepts
03. oop concepts03. oop concepts
03. oop concepts
 
OOP Basic
OOP BasicOOP Basic
OOP Basic
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
Share point developement Introduction for students
Share point developement Introduction for studentsShare point developement Introduction for students
Share point developement Introduction for students
 
Oop basic overview
Oop basic overviewOop basic overview
Oop basic overview
 
Apps for SharePoint 2013
Apps for SharePoint 2013Apps for SharePoint 2013
Apps for SharePoint 2013
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
SharePoint 2013 variations feature
SharePoint 2013 variations featureSharePoint 2013 variations feature
SharePoint 2013 variations feature
 
PHP Classes and OOPS Concept
PHP Classes and OOPS ConceptPHP Classes and OOPS Concept
PHP Classes and OOPS Concept
 
Infopath controls
Infopath controlsInfopath controls
Infopath controls
 

Similar a Oop concepts

Similar a Oop concepts (20)

9 crucial Java Design Principles you cannot miss
9 crucial Java Design Principles you cannot miss9 crucial Java Design Principles you cannot miss
9 crucial Java Design Principles you cannot miss
 
Obj c
Obj cObj c
Obj c
 
Ruby Object Design
Ruby Object DesignRuby Object Design
Ruby Object Design
 
Ruby Object Design
Ruby Object DesignRuby Object Design
Ruby Object Design
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGi
 
Reflection in Java
Reflection in JavaReflection in Java
Reflection in Java
 
Java
JavaJava
Java
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
Developer Friendly API Design
Developer Friendly API DesignDeveloper Friendly API Design
Developer Friendly API Design
 
01 persistence and domain modeling
01 persistence and domain modeling01 persistence and domain modeling
01 persistence and domain modeling
 
Design Patterns (Examples in .NET)
Design Patterns (Examples in .NET)Design Patterns (Examples in .NET)
Design Patterns (Examples in .NET)
 
OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.
 
Obj c
Obj cObj c
Obj c
 
Code like a ninja session 1 object-oriented principles
Code like a ninja  session 1   object-oriented principlesCode like a ninja  session 1   object-oriented principles
Code like a ninja session 1 object-oriented principles
 
7494611
74946117494611
7494611
 
Fi arch design-principles-new_seeds-v0.7.4
Fi arch design-principles-new_seeds-v0.7.4Fi arch design-principles-new_seeds-v0.7.4
Fi arch design-principles-new_seeds-v0.7.4
 
Pbasanta@jtres06 extendedportal
Pbasanta@jtres06 extendedportalPbasanta@jtres06 extendedportal
Pbasanta@jtres06 extendedportal
 
Core Java for Selenium
Core Java for SeleniumCore Java for Selenium
Core Java for Selenium
 
How to Choose the Right API Management Solution
How to Choose the Right API Management SolutionHow to Choose the Right API Management Solution
How to Choose the Right API Management Solution
 
Introducing symfony2
Introducing symfony2Introducing symfony2
Introducing symfony2
 

Último

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
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...Jeffrey Haguewood
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
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...Orbitshub
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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, ...Angeliki Cooney
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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.pptxRustici Software
 
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 Takeoffsammart93
 
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 Pakistandanishmna97
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
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 connectorsNanddeep Nachan
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
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].pdfOverkill Security
 
"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 ...Zilliz
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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 2024The Digital Insurer
 
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 2024Victor Rentea
 

Último (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
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...
 
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, ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
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
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
"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 ...
 
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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
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
 

Oop concepts

  • 1. OOP Programming Melick R. Baranasooriya melick-rajee.blogspot.com
  • 2. Principles of OOP Abstraction Inheritance Encapsulation Polymorphism 2
  • 3. Inheritance Staff Member Gold Loyalty Non Regular Member 3
  • 4. Classes and Interfaces Classes Interfaces methods and Methods contain Fields, properties, properties, left to code for methods be implemented 4 execution later
  • 5. 5
  • 6. Inheritance characteristics of existing Attributes parent class Operations extend the Add new Redefine parent fields and methods class methods 6
  • 7. Extensibility Inheritance Reusability inherits Provides abstraction Eliminates implements Extends redundant code 7
  • 8. 8
  • 9. Accessibility Levels protected internal - limited Private - to the current assembly or types derived from restricted to the the containing class containing type Protected - Public – limited to the Internal - containing type and limited to the current access is not assembly 9 types derived from it restricted
  • 10. Important Aspects Instance and static constructors No multiple are not inherited inheritance Multiple Transitive relation Structures cannot interfaces can be C < - B , B < -A be inherited implemented then C <-A 10
  • 11. Demo Virtual + Sealed Override Multiple Methods + New Access Modifiers Interfaces 11
  • 12. Abstraction – Reducing the complexity Classes defined with the Class + keyword abstract Interface Not implemented Implemented or methods are Cannot be fully declared instantiated unimplemented 12 abstract
  • 13. 13
  • 14. Encapsulation Hides the implementation Public details interface No interface All data members Accessed via members should should be hidden properties be hidden 14
  • 15. Encapsulation .. Constructors Private data fields and Assessors Reduces Changing the complexity Change fields class internals validation Easier does not affect 15 maintenance
  • 16. Polymorphism Extensibility Cohesion and Coupling Reusability Having many forms Provides abstraction Virtual Override Eliminates Keyword Keyword redundant code 16
  • 17. 17