This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

PHP to objects and beyond

Syllabus for PHP to objects and beyond

Luka Muzinic's picture
Sun, 2010-12-26 13:04

Introduction

Week 1

Introduction to classes and objects, how to declare them and instantiate.
Adding properties and methods, learning about constructor methods.
Inheritance.
Types of access.

Reading materials for week 1

Object-Oriented PHP for Beginners, you can skip the parts about Static properties and methods (they will be covered next week), Commenting with DocBlocks (out of scope for this course). Read last part of this article, Comparing OO and procedural code if you want to know more (highly recommended)

Assignment

Find a real world example of objects and use analogy in writing example PHP code. If you wanted to use a car in explaining OOP, you could do something like this. Go throught whole article and write code for each section. When finnished use Pastie to publish your code and post a link on forum topic Week 1 for others to see, comment and learn from.

Week 2

Static methods and properties.
Abstract classes and interfaces.
Final classes.
Overloading

Reading materials for week 2

For static methods and properties we have two articles. One on php.net, one on phpduck.com.
PHP manual also has some reading and examples on abstract classes and on interfaces. Also, read Understanding and Applying Polymorphism in PHP it ties it neatly altogether.
Final classes, very short read.
Overloading is optional reading, especially if you know overloading from other programming languages, you will get dissappointed ;-)

Assignment

I would like to try one group exercise. Define an interface for your real world example (or choose something else), use Pastie to publish it on forum topic Week 2. Wait for your peers to publish theirs, choose one, and implement it.

Week 3

How object oriented programming differs from procedural one.
Polymorphism.
Encapsulation.

Design patterns

Week 4

Behavioral patterns. Observer, NULL object.

Week 5

Creational patterns. Singleton, Factory, Builder.

Week 6

Structural patterns. Adapter, Decorator, Facade.

Comments

Please I need more lessons on

Victor Adeyemo's picture
Victor Adeyemo
Wed, 2011-01-19 23:29

Please I need more lessons on Static methods and properties.
Abstract classes and interfaces.
Final classes.
Interceptors (overloading).. thanks!

Syllabus updated with Week

Luka Muzinic's picture
Luka Muzinic
Mon, 2011-02-21 23:58

Syllabus updated with Week 1's reading and coding assignments.

Don't know what happend but I

Bienvenido Del Rosario's picture
Bienvenido Del Ro...
Wed, 2011-03-30 15:16

Don't know what happend but I haven't seen any new info for the course since Week 2