News Feed
Sections




News Archive
feed this:

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

PHPMaster.com:
An Intro to Virtual Proxies, Part 2
April 26, 2012 @ 09:24:23

Following up on his previous article, Alejandro Gervasio has a new post to PHPMaster.com with the second part of his series on using virtual proxies in PHP.

Resting on the foundation of Polymorphism (dynamic Polymorphism, not the ad-hoc one often achieved through plain method overriding), Virtual Proxies are a simple yet solid concept which allows you to defer the construction/loading of expensive object graphs without having to modify client code.

He shows how to create a collection of domain objects that use proxies to populate their data. He includes the code for creating a "Post" interface/object as well as a Comment interface/object. These are put into a "CommentCollection" and, when it's accessed, pull the item in the collection out, only populating the data on demand.

0 comments voice your opinion now!
virtual proxies introduction series collection domain object


Ivo Jansch's Blog:
Building proxies, decorators and delegates in PHP5
July 03, 2006 @ 19:54:13

Ivo Jansch today gives an excellent look on proxies, decorators and delegates; three popular desigh patterns.

In PHP5, you can define methods in an object for intercepting calls to methods of an object and for intercepting access to object member variables. These methods (__get, __set and __call) enable the implementation of very generic proxies, decorators and delegators.

This is a great introduction to these three patterns and how to implement them in PHP

0 comments voice your opinion now!
design patterns proxies decorators delegates design patterns proxies decorators delegates



Community Events





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


opinion refactor series release install framework interview symfony2 podcast unittest api threedevsandamaybe list laravel introduction language code community testing developer

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