 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Matthew Weier O'Phinney's Blog: Why PHP Namespaces Matter
by Chris Cornutt February 04, 2011 @ 13:23:22
Matthew Weier O'Phinney has a new post today talking about why namespaces in PHP matter and why he thinks they're a valuable contribution to the language.
You've heard about PHP namespaces by now. Most likely, you've heard about -- and likely participated in -- the bikeshedding surrounding the selection of the namespace separator. Regardless of your thoughts on the namespace separator, or how namespaces may or may not work in other languages, I submit to you several reasons for why I think namespaces in PHP are a positive addition to the language.
He breaks down his reasons into four different categories - the code organization benefits that come with namespace "containers", simplified interface structure, improved readability (no more huge class names) and a simpler method for identifying dependencies
voice your opinion now!
namespace opinion organization interface readability dependencies
Evert Pot's Blog: Dangers of mutual dependencies
by Chris Cornutt March 06, 2009 @ 13:42:40
In a recent post to his blog Evert Pot warns against some of the issues that mutual dependencies in your applications.
Much like most people, I try work out my class dependencies through a top-down 'waterfall'-ish approach. By attempting this, I think allows me to keep the structure very clear and understandable. [...] I try to apply the same model to instantiated objects and packages (groups of classes). When an object encapsulates another object, I attempt to make sure the sub-object object is not aware of the parent. When I design packages, I attempt to make sure 2 packages don't require 'each other'.
He gives an example of where this could cause problems - a Database logger that has three types of logging included: file, syslog and database. Obviously the last of the three requires the Database class so they must always be used/included together.
As a bonus a database-error could occur while logging, resulting in an endless loop (or segmentation fault if you're using PHP). [...] However, these types of situations are sometimes simply unavoidable (that's why we have include_once). When they are needed, they should be implemented with care and consideration.
voice your opinion now!
mutual dependencies dependent class database log example
Jani Hartikainen's Blog: Improved Zend Framework package maker
by Chris Cornutt November 14, 2008 @ 08:49:51
Jani Hartikainen has made a few updates to his packageizer script for the Zend Framework to improve its interface.
Now, based on some feedback from users, I've improved the user interface of the tool: You can now select multiple items for inclusion in the package, and I've made it possible to get the packages in .phar format. It also has initial support for different libraries, ie. Zend Framework 1.6 and Zend Framework SVN trunk, but currently only 1.6 stable is available.
The tool allows you to select just the packages out of the Zend Framework that you might want to work with and packages them up, along with their dependencies, into a simple, portable file that can be used anywhere the Framework normally could.
voice your opinion now!
zendframework package packageizer dependencies make
Helgi's Blog: PEAR installer updating its PHP deps
by Chris Cornutt August 12, 2008 @ 12:04:26
Helgi has posted about an update to the next alpha release of PEAR to remove support for certain versions of PHP:
For the next alpha release of PEAR that will happen in 2 - 4 weeks we'll have a min dep of PHP 4.4 and 5.1.6, so basically excluding 5.0.0 - 5.1.5 Now why am I going to do that?
This pushes more people up from the PHP 4.3.x series (to the 4.4.x that was the last PHP4 release) and up to a more recent PHP5 version for the future. Eventually, PHP4 support will be dropped all together, but for now there's a bit of a hold out.
voice your opinion now!
pear installer dependencies php4 php5 support version
SitePoint PHP Blog: Dealing with Dependencies
by Chris Cornutt February 04, 2008 @ 12:09:00
On the SitePoint PHP blog today, Troels Knak-Nielsen has written up an article that talks about dependencies in your applications - those little interconnections your code relies on to do more with less.
In lack of better words, I'll call this compositional programming style. It's a style which is usually more prevalent with experienced programmers. [...] There is, however, a dark side to composition - dependencies.
He starts with a definition to bring everyone up to a level field then moves on to how their used (through a "global symbol" or directly passed in) and how they can "leak" if you're not careful.
To help protect you and your code from any kind of damage down the line, Troels suggests making a container to keep objects where they need to be. He even includes an example with namespace support to make things even easier down the road.
voice your opinion now!
dependencies tutorial compositional programming container leak namespace
|
Community Events
Don't see your event here? Let us know!
|