You are here: Re: Namespaces? Why? « PHP Programming Language « IT news, forums, messages
Re: Namespaces? Why?

Posted by Steve on 09/27/07 21:20

"RageARC" <ragearc@gmail.com> wrote in message
news:1190927085.689670.284400@w3g2000hsg.googlegroups.com...
> Somewhat. Apparently, what you mean is that the way I'm doing Libri
> (My Database Handler for ALL database servers supported by PHP and
> some more) wouldn't profit from namespaces, but here's another
> example:

jesus no! that's not at all what i'm saying. i'm saying they have NOTHING to
do with eachother! MYQSL is a CLASS OBJECT. connect is an INTERFACE. though
a namespace may look the same in syntax when being reference, that certainly
do not at all mean they are! you can have namespaces that define a host of
classes to avoid not being able to create another class with the exact same
name (that may or may not be in a namespace of its own). namespaces are
invaluable, if you know what they are and how to use them.

> X is a package that has a class called DB.
> Y is a package that has a class called DB.
>
> I want to use both packages in my code. There will be a collision. I
> can then use:
>
> X:: ...
> Y:: ...
>
> And safely execute both packages without seeing problems happening.

that is a primary benefit of a namespace, but certainly not the only one.
;^)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация