Re: Question about Namespace patch
| From: | Paweł Stradomski | Date: | Mon, 23 Jul 2007 09:40:55 +0000 |
| Subject: | Re: Question about Namespace patch | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-31179@lists.php.net to get a copy of this message | ||
Stanislav Malyshev wrote:
> > working with a large library and have to import a lot of classes, the
> > way this works is nothing but a pain. We would be better off not using
> > namespaces at all, in this case. Thus, the problem has not been solved.
>
> Once more, you DO NOT have to import a lot of classes. Please do read
> what I write. You SHOULD NOT import classes in global space. Namespaces
> are NOT the way to bring all classes in global space, and it should not
> be done.
OK, so suppose I want to have four namespaces for my project:
MyApp for some shared code,
MyApp::Model
MyApp::Controller
MyApp::View
Now in many places in my code in Model I'd use some ORM library - let's assume
it's similar to python's SQLAlchemy. Now is there any way for me to have
access **in Model namespace** to all classes from SQLAlchemy namespace
without using
import SQLAlchemy::Column
import SQLAlchemy::Table
import SQLAlchemy::Join
import SQLAlchemy::ForeignKey
import SQLAlchemy::Session
import SQLAlchemy::Transaction
and tens of other classes? I know your patch makes it possible to use fully
qualified names everywhere.
--
Paweł Stradomski