Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Blue Parabola Blog:
Objectively Oriented
Feb 18, 2009 @ 15:31:30

On the Blue Parabola blog, Matthew Turland takes a look at object-oriented programming and what core concepts lie at its heart.

What is object-oriented programming? The acronym OOP has become a bit of a buzzword in the current age of programming, to the point where the waters of its definition have become rather murky. [...] PHP may not be object-oriented, but from a purist perspective, neither is Java. What do I mean by "purist perspective?" Plain and simple: everything is either an object or a message being passed between objects (where message parameters are also objects).

He mentions one of the first languages to support objects (Simula) and the four fundamental concepts that would make a language truly OOP - abstraction, inheritance, encapsulation, polymorphism. Its his opinion, though, that while its good for languages to adhere to these four principles as much as they can, discussions about how well they adhere to them is usually just "spinning your wheels" and don't have much use.

tagged: object oriented definition abstraction inheritance encapsulation ploymorphism

Link:

PHPro.org:
Class Hierachies And Overriding
Nov 20, 2008 @ 14:46:47

The PHPro.org website has this new tutorial posted today - a step further into the would of OOP in PHP with a look at abstraction, hierarchies and polymorphism.

The PHP Object Oriented method of programming brings many exciting possibilities to application code. Many of the theories surrounding PHP Object Oriented code comes from some simple concepts. To the new comer, some of these concepts seem a little abstract, and with good reason. Abstraction is a key concept on Object Oriented code, but to the un-initiated, may seem rather vague.

Kevin looks at creating abstract classes as a foundation for types other classes can work from, overriding built in classes (like extending the DirectoryIterator to make a DirectoryReader class).

tagged: class hierarchies overriding tutorial abstraction ploymorphism

Link:


Trending Topics: