News Feed
Sections




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

Paul Jones' Blog:
Universal Constructor Sighting "In The Wild"
July 12, 2010 @ 09:56:22

In a new post to his blog Paul Jones talks about spotting something "in the wild" that he's a proponent of - a "universal constructor".

For those of you who don't know, "universal constructor" is the name I give to PHP constructors that always and only take a single parameter. The parameter is an array of key-value pairs, which is then merged with a set of default keys and values. Finally, the array is unmarshalled, usually into object properties.

He talks about the benefits of using a constructor like this in your applications and how he's implemented it as a standard part of the Solar framework. Oh, and the sighting in the wild? It was in this MongoDB session handler.

Be sure to check out the comments for some other great opinions on this "universal constructor" idea, both for and against.

0 comments voice your opinion now!
constructor universal opinion solarphp framework


blog comments powered by Disqus

Similar Posts

Sanisoft Blog: Using CakePHP without a database

NETTUTS.com: How to Use CakePHP's Access Control Lists

Alexander Netkachev's Blog: Create Ajax Login page with Dojo toolkit and Zend Framework

Test.ical.ly Blog: PHP 5.3 and the Symfony2 UniversalClassLoader - Where to load?

SaniSoft Blog: Bugs & enhancements for Auth component in CakePHP v1.2 - Part 1


Community Events





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


framework series language community interview laravel version opinion security tool composer package symfony update release introduction mvc voicesoftheelephpant library podcast

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