PHP Classes and Object-Oriented Programming: Definitions, Inheritance, and Components, Slides of Geochemistry

Examples and explanations of php classes, creating objects, setting properties, and calling methods. It also covers inheritance, polymorphism, and the relationship between objects through association, aggregation, and instantiation. Additionally, it introduces the concept of components in object-oriented programming, including object linking and embedding (ole), component object model (com), dcom/cobra, javabeans, and .net.

Typology: Slides

2012/2013

Uploaded on 07/23/2013

ramanuja
ramanuja 🇮🇳

4.7

(3)

56 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PHP Examples(1)
Generalised definition of a class:
class myClass {
var $myValue;
function myMethod() {
return 0;
}
}
Creating an object (class instance):
$myObject = new myClass;
Docsity.com
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download PHP Classes and Object-Oriented Programming: Definitions, Inheritance, and Components and more Slides Geochemistry in PDF only on Docsity!

PHP Examples(1)

  • Generalised definition of a class:

class myClass { var $myValue; function myMethod() { return 0; } }

  • Creating an object (class instance):

$myObject = new myClass;

PHP Examples(2)

  • Setting the property of an object:

$myObject->myValue = “Data Value”;

  • Calling a method:

$myObject->myMethod();

  • N.B. Most languages use dots rather than ->

Inheritance

Aggregation

Instantiation

Holiday^ Overdraft

Components