On Mon, 2004-03-29 at 17:01, Justin Palmer wrote:
> Hi,
> 
> I did not think that PHP supported namespaces?  I would love to see it
> if it is possible.  What sparked my interest was this post:
> 
> http://news.php.net/article.php?group=php.general&article=181728
> 
> <quote>
> There are lots of other things, of course. One method of learning about
> this would be to take every OO term (encapsulation, namespacing, etc.)
> and
> find a really good explanation of the term.
> </quote>
> 
> Let me know.

PHP doesn't support namespaces; however, functions defined within a
class definition are essentially conform to namespace ideology since the
function would need to be defined twice in the same class to cause an
collision. In practice this doesn't happen, hwoever the possiblity for
class names to collide is still an issue. Class names generally collide
less than raw functions. It is also useful to point out that a
heirarchical naming scheme for functions provides the same benefit. For
instance contrast:

class Session
{
    function getData( $key )
    {
        // Some code.
    }

    function setData( $key, $value )
    {
        // Some code.
    }
}

Versus the following function naming scheme:

function Session_getData( $sessResource, $key )
{
    // Some code.
}

function Session_setData( $sessResource, $key, $value )
{
    // Some code.
}

HTH and HAND and Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to