News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

PHP 10.0 Blog:
duck operator
June 05, 2008 @ 14:36:31

In this new post to the PHP 10.0 blog today, Stas talks about duck typing, a method that lets the code decide the functionality to use rather than a direct relation to a parent.

Well, if you are into duck typing style of programming, it may be interesting for you to have an object that implements certain set of functions, but not necessary declares it at class definition. Languages like Smalltalk do it all day along, so why PHP couldn't?

His example defines an interface Cow and a class MooingGrassEater and a function, CowConsumer, that does the work. A classname is passed in and an instance of that class is checked with "implements" rather than "instanceof" to see if it uses the Cow interface. He points out a place where PHP itself uses something similar in user defined streams.

0 comments voice your opinion now!
duck operator instanceof implements class interface relation



Tobias Schlitt's Blog:
Object relation mapping in eZ Components
March 01, 2007 @ 10:03:00

Tobias Schlitt has pointed out a new article he's written up that acts as an introduction to the features of the new ORM component of the eZ Components application framework - the PersisteneObject.

For me the coolest feature of PersistentObject is, that the component does not require you're ORM enabled classes to inherit from a certain base to allow your objects to be stored in a database (made persistent).

This new object gives you a "wapper" of sorts to make any of the pre-existing objects in your application persistent. Check out the article for more.

0 comments voice your opinion now!
object persistent ezcomponents relation mapping persistentobject object persistent ezcomponents relation mapping persistentobject



Community Events











Don't see your event here?
Let us know!


zend package code PHP5 security conference application release releases mysql database cakephp book example framework developer zendframework job ajax PEAR

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework