Object Oriented Programming - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Object Oriented Programming

Description:

objectName = new ConstructorName( argumentList ) How to call a function with an object: ... return `date`; OOP in PHP: Other concepts (similar to Java) ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 9
Provided by: capi7
Category:

less

Transcript and Presenter's Notes

Title: Object Oriented Programming


1
Object Oriented Programming
  • Integers, floating point numbers, strings, .. are
    convenient but
  • In the real world, we have more complex entities
    we want to deal with users, posts, videos,
  • OOP enables us to manipulate these entities as a
    whole

2
OOP in PHP
  • Similar concepts to OOP in Java
  • Class
  • Objects
  • Private, protected, public
  • Constructors, accessors, mutators

3
OOP in PHP
  • function functionName( parameterList )
  • // code here
  • // function can return a value or an object ..

4
OOP in PHP
  • How to instantiate an object
  • objectName new ConstructorName( argumentList )
  • How to call a function with an object
  • result objectName-gtfunctionName( argumentList
    )

5
OOP in PHP
  • We can have constants in a class
  • const LAST_MONTH December

6
OOP in PHP
  • We can have static variables or functions in a
    class (similar to Java)
  • static function today( )
  • return date

7
OOP in PHP Other concepts (similar to Java)
  • Inheritance (keyword is extends)
  • Abstract classes and functions (keyword is
    abstract)
  • Interfaces
  • Inheritance from an interface (keyword is
    implements)
  • Phpdoc (online documentation)

8
OOP in PHP Other concepts
  • Can use a framework to manage how your web site
    is organized
  • Two popular frameworks are
  • Cake
  • symfony
Write a Comment
User Comments (0)
About PowerShow.com