SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Cake PHP – OOPS approach for PHP


                       www.otssolutions.com
What is CakePHP ?
• CakePHP is written in PHP and is modeled
  after the concepts of Ruby on Rails (ROR)
• CakePHP is a rapid development framework
  for PHP that provides an extensible
  architecture for
  developing, maintaining, and deploying
  applications.
• CakePHP makes use of commonly known
  design patterns like
  ActiveRecord, Association Data
Why use CakePHP ?
• Model, View, Controller Architecture
• Helps developers to reduce code
  repentance in creation of websites or web
  applications.
• Application Scaffolding.
• Built in view helpers for AJAX, JavaScript,
  HTML Forms.
• Access Control Lists
Why use CakePHP ?
• Data Sanitization
• Security, Session, and Request Handling
  Components
• Flexible View Caching
• Full support for PHP OOP’s approach
           And
• It is developed under the MIT license so it
  is free for everyone
Where to use CakePHP ?
• Highly scalable projects
• Projects with Heavy Database Interactions
  and Object Relational Mapping
• Projects where caching is needed
• Projects which needs to be implemented
  with MVC approach
• Where code re-usability is necessity
Where not to use CakePHP ?
•   Basic Blog
•   Basic CMS
•   Basic E-Commere
•   Basic Forums / Bulletin Boards
Who is using CakePHP ?
What is MVC approach?
What is MVC approach?
• Model/View/Controller (MVC) is a
  software architecture used for building
  applications.
• MVC separates the business logic and
  application data from the presentation
  data to the user.
• Applications built using MVC approach are
  re-usable and expressive.
What is OOPs?
• Object-oriented programming is a method
  of implementation in which programs are
  organized as cooperative collections of
  objects, each of which represents an
  instance of some class, and whose
  classes are all members of one or more
  hierarchy of classes united via inheritance
  relationships.
OOPs advantages over conventional approaches
 • OOP provides a clear modular structure
   for programs which makes it good for
   defining abstract data types where
   implementation details are hidden and the
   unit has a clearly defined interface..
 • OOP makes it easy to maintain and modify
   existing code as new objects can be
   created with small differences to existing
   ones.
OOPs advantages over conventional approaches
 • OOP provides a good framework for code
   libraries where supplied software
   components can be easily adapted and
   modified by the programmer. This is
   particularly useful for developing graphical
   user interfaces.
Characteristics of OOPs
 • Class definitions
 • Objects
 • Abstraction
 • Encapsulation
 • Inheritance
 • Generic classes
 • Polymorphism
    • Operator and Function overloading.
 • Message Passing
How OOPs work
 • Classes describe objects
 • Objects inherit from superclasses
Class Hierarchies
Advantages of OOPs
 •   Simplicity
 •   Modularity
 •   Modifiability
 •   Extensibility
 •   Maintainability
 •   Re-usability
OOPs in PHP
 • PHP 5 has a full object model as
   compared to PHP4.
 • PHP treats objects in the same way as
   references or handles, meaning that each
   variable contains an object reference
   rather than a copy of the entire object.
 • PHP supports Visibility, abstract and final
   classes and methods , additional magic
   methods, interfaces, cloning and
   typehinting
OOPs Features in PHP
 Autoloading : Autoloading is a mechanism
 where you can specify where the code
 should look for a class name that follows a
 particular pattern. Once you have set this
 up, usually very early in the script when
 everything gets configured, then you can
 simply instantiate classes without having to
 expressly include their declaration files.
OOPs Features in PHP
 Interfaces : PHP does not have multiple
 inheritance, so each object can only have
 one parent, and the top-level parent of all
 objects is of type StdClass. However PHP
 does support interfaces, which allows
 polymorphism (one class which can look like
 another) in PHP.
OOPs Features in PHP
 Type Hinting : We use the instanceOf
 comparison operator to check that an object
 with the correct capabilities had been
 received, but we can make this simpler by
 using type hinting in our functions and object
 methods. .
OOPs Features in PHP
 Fluent Interfaces : This is a neat trick that
 can often be seen in particular in framework
 code, so it is worth a mention here. A “fluent
 interface” is one where you can chain the
 methods together, useful especially where
 you would be calling a sequence of methods
 on the same object.
Address
United States
Glendale
Glendale Plaza
655 North Central Avenue
17th Floor
Glendale, California 91203
Ph: +1 408 540 0001

United kingdom
No 1 Liverpool Street
London EC2M7QD
United Kingdom
Ph: +44 208 099 1660
Gurgaon ( Haryana )
795, Udyog Vihar, Phase-V
Gurgaon (Haryana) India
Ph: +91 124 4748100
+91 124 4748101

US: +1 408.540.0001
UK: +44 208.099.1660
AU: +61 280.114.816
India : +91 124.474.8100 | +91 124.474.8101
Thank You
USA
                                      United kingdom                            India
Glendale
Glendale Plaza                         London                                   Gurgaon ( Haryana )
                                                                                795, Udyog Vihar, Phase-V
655 North Central Avenue               No 1 Liverpool Street
                                                                                Gurgaon(Haryana) India
17th Floor                             London EC2M 7QD
                                                                                Ph: +91 124 4101350
Glendale, California 91203             United Kingdom
                                                                                +91 124 4748100
United States                          Ph: +44 208 099 1660
Ph: +1 408 540 0001
                                                                                Write to us at: sales@otssolutions.com
Write to us at: sales@otssolutions.com Write to us at: sales@otssolutions.com
                                                                                    http://www.otssolutions.com/

Weitere ähnliche Inhalte

Mehr von Deepika Chaudhary

WINDOWS COMMUNICATION FOUNDATION
WINDOWS COMMUNICATION FOUNDATIONWINDOWS COMMUNICATION FOUNDATION
WINDOWS COMMUNICATION FOUNDATIONDeepika Chaudhary
 
Cake php oops approach for php
Cake php  oops approach for phpCake php  oops approach for php
Cake php oops approach for phpDeepika Chaudhary
 
Creativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentCreativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentDeepika Chaudhary
 
Creativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentCreativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentDeepika Chaudhary
 
Java application-development-in-india
Java application-development-in-indiaJava application-development-in-india
Java application-development-in-indiaDeepika Chaudhary
 
Net application-development–business-growth-with-net
Net application-development–business-growth-with-netNet application-development–business-growth-with-net
Net application-development–business-growth-with-netDeepika Chaudhary
 
Hire Dedicated Java Developers
Hire Dedicated Java DevelopersHire Dedicated Java Developers
Hire Dedicated Java DevelopersDeepika Chaudhary
 
Java application-development
Java application-developmentJava application-development
Java application-developmentDeepika Chaudhary
 
Software development companies in india
Software development companies in indiaSoftware development companies in india
Software development companies in indiaDeepika Chaudhary
 
Java the reason behind its never ending demand
Java the reason behind its never ending demandJava the reason behind its never ending demand
Java the reason behind its never ending demandDeepika Chaudhary
 
Know all about android development
Know all about android developmentKnow all about android development
Know all about android developmentDeepika Chaudhary
 
OTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationOTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationDeepika Chaudhary
 
OTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationOTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationDeepika Chaudhary
 

Mehr von Deepika Chaudhary (13)

WINDOWS COMMUNICATION FOUNDATION
WINDOWS COMMUNICATION FOUNDATIONWINDOWS COMMUNICATION FOUNDATION
WINDOWS COMMUNICATION FOUNDATION
 
Cake php oops approach for php
Cake php  oops approach for phpCake php  oops approach for php
Cake php oops approach for php
 
Creativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentCreativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-development
 
Creativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentCreativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-development
 
Java application-development-in-india
Java application-development-in-indiaJava application-development-in-india
Java application-development-in-india
 
Net application-development–business-growth-with-net
Net application-development–business-growth-with-netNet application-development–business-growth-with-net
Net application-development–business-growth-with-net
 
Hire Dedicated Java Developers
Hire Dedicated Java DevelopersHire Dedicated Java Developers
Hire Dedicated Java Developers
 
Java application-development
Java application-developmentJava application-development
Java application-development
 
Software development companies in india
Software development companies in indiaSoftware development companies in india
Software development companies in india
 
Java the reason behind its never ending demand
Java the reason behind its never ending demandJava the reason behind its never ending demand
Java the reason behind its never ending demand
 
Know all about android development
Know all about android developmentKnow all about android development
Know all about android development
 
OTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationOTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentation
 
OTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationOTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentation
 

Kürzlich hochgeladen

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
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 educationjfdjdjcjdnsjd
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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 TerraformAndrey Devyatkin
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Cake php oops approach for php

  • 1. Cake PHP – OOPS approach for PHP www.otssolutions.com
  • 2. What is CakePHP ? • CakePHP is written in PHP and is modeled after the concepts of Ruby on Rails (ROR) • CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. • CakePHP makes use of commonly known design patterns like ActiveRecord, Association Data
  • 3. Why use CakePHP ? • Model, View, Controller Architecture • Helps developers to reduce code repentance in creation of websites or web applications. • Application Scaffolding. • Built in view helpers for AJAX, JavaScript, HTML Forms. • Access Control Lists
  • 4. Why use CakePHP ? • Data Sanitization • Security, Session, and Request Handling Components • Flexible View Caching • Full support for PHP OOP’s approach And • It is developed under the MIT license so it is free for everyone
  • 5. Where to use CakePHP ? • Highly scalable projects • Projects with Heavy Database Interactions and Object Relational Mapping • Projects where caching is needed • Projects which needs to be implemented with MVC approach • Where code re-usability is necessity
  • 6. Where not to use CakePHP ? • Basic Blog • Basic CMS • Basic E-Commere • Basic Forums / Bulletin Boards
  • 7. Who is using CakePHP ?
  • 8. What is MVC approach?
  • 9. What is MVC approach? • Model/View/Controller (MVC) is a software architecture used for building applications. • MVC separates the business logic and application data from the presentation data to the user. • Applications built using MVC approach are re-usable and expressive.
  • 10. What is OOPs? • Object-oriented programming is a method of implementation in which programs are organized as cooperative collections of objects, each of which represents an instance of some class, and whose classes are all members of one or more hierarchy of classes united via inheritance relationships.
  • 11. OOPs advantages over conventional approaches • OOP provides a clear modular structure for programs which makes it good for defining abstract data types where implementation details are hidden and the unit has a clearly defined interface.. • OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones.
  • 12. OOPs advantages over conventional approaches • OOP provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. This is particularly useful for developing graphical user interfaces.
  • 13. Characteristics of OOPs • Class definitions • Objects • Abstraction • Encapsulation • Inheritance • Generic classes • Polymorphism • Operator and Function overloading. • Message Passing
  • 14. How OOPs work • Classes describe objects • Objects inherit from superclasses
  • 16. Advantages of OOPs • Simplicity • Modularity • Modifiability • Extensibility • Maintainability • Re-usability
  • 17. OOPs in PHP • PHP 5 has a full object model as compared to PHP4. • PHP treats objects in the same way as references or handles, meaning that each variable contains an object reference rather than a copy of the entire object. • PHP supports Visibility, abstract and final classes and methods , additional magic methods, interfaces, cloning and typehinting
  • 18. OOPs Features in PHP Autoloading : Autoloading is a mechanism where you can specify where the code should look for a class name that follows a particular pattern. Once you have set this up, usually very early in the script when everything gets configured, then you can simply instantiate classes without having to expressly include their declaration files.
  • 19. OOPs Features in PHP Interfaces : PHP does not have multiple inheritance, so each object can only have one parent, and the top-level parent of all objects is of type StdClass. However PHP does support interfaces, which allows polymorphism (one class which can look like another) in PHP.
  • 20. OOPs Features in PHP Type Hinting : We use the instanceOf comparison operator to check that an object with the correct capabilities had been received, but we can make this simpler by using type hinting in our functions and object methods. .
  • 21. OOPs Features in PHP Fluent Interfaces : This is a neat trick that can often be seen in particular in framework code, so it is worth a mention here. A “fluent interface” is one where you can chain the methods together, useful especially where you would be calling a sequence of methods on the same object.
  • 22. Address United States Glendale Glendale Plaza 655 North Central Avenue 17th Floor Glendale, California 91203 Ph: +1 408 540 0001 United kingdom No 1 Liverpool Street London EC2M7QD United Kingdom Ph: +44 208 099 1660
  • 23. Gurgaon ( Haryana ) 795, Udyog Vihar, Phase-V Gurgaon (Haryana) India Ph: +91 124 4748100 +91 124 4748101 US: +1 408.540.0001 UK: +44 208.099.1660 AU: +61 280.114.816 India : +91 124.474.8100 | +91 124.474.8101
  • 25. USA United kingdom India Glendale Glendale Plaza London Gurgaon ( Haryana ) 795, Udyog Vihar, Phase-V 655 North Central Avenue No 1 Liverpool Street Gurgaon(Haryana) India 17th Floor London EC2M 7QD Ph: +91 124 4101350 Glendale, California 91203 United Kingdom +91 124 4748100 United States Ph: +44 208 099 1660 Ph: +1 408 540 0001 Write to us at: sales@otssolutions.com Write to us at: sales@otssolutions.com Write to us at: sales@otssolutions.com http://www.otssolutions.com/