[Solar-talk] Namespaces

Paul M Jones pmjones at paul-m-jones.com
Fri Feb 29 15:16:13 CST 2008


Forwarding to create a new thread. ;-)

Begin forwarded message:

> From: Jeff Moore <jeff at mashery.com>
> Date: February 29, 2008 15:08:40  CST
> To: solar-talk at lists.solarphp.com
> Subject: Re: [Solar-talk] Toward a Standard Project Structure
> Reply-To: solar-talk at lists.solarphp.com
>
> Hi,
>
> I just wanted to point out that the current autoloading mapping  
> might need to be reconsidered in light of namespaces.
>
> Does the Solar class belong inside a Solar namespace?  If so, the  
> file (Solar.php) would most likely go inside the Solar directory and  
> Solar::start() becomes Solar::Solar::start();
>
> Consider Solar_View.  With namespaces, will this become Solar::View?
> Now Consider Solar_View_Helper.  Is this:
>
> Solar_View::Helper or Solar::View_Helper?
>
> If Solar_View_Helper should be Solar_View::Helper, then Solar_View  
> should be Solar_View::View.
>
> I'm calling things like Solar::Solar and Solar_View::View the  
> "Namespace stutter," which ironically makes names longer when they  
> use namespaces.  Perhaps not what the people who thought namespaces  
> would deliver them from the lengthy class names of the PEAR  
> convention had in mind?  Still, I think its the right thing to do,  
> that the "main" class should be inside the namespace.
>
> Now whether Solar would be distributed as one namespace or many  
> (Solar_View::, Solar_Controller::, etc), I don't know.
>
> Maybe for BC namespaces will be shunned entirely?
>
> Just some thoughts,
>
> Jeff
>
> On Feb 29, 2008, at 6:49 AM, Paul M Jones wrote:
>
>>           Solar.php           # ln -s ../source/solar/Solar.php
>>           Solar/              # ln -s ../source/solar/Solar
> _______________________________________________
> Solar-talk mailing list
> Solar-talk at lists.solarphp.com
> http://mailman-mail3.webfaction.com/listinfo/solar-talk



More information about the Solar-talk mailing list