[Typo3-dev] Library manager instead of globals
Martin T. Kutschker
Martin.T.Kutschker at blackbox.net
Tue Mar 16 12:17:29 CET 2004
dan frost wrote:
> Last night I built a library manager to cope with a load of the classes
> I'm using.
Generally speaking a good idea.
I know I'm nitpicking but I don't like the nomenclatura.
registerClass() and createInstance() or getInstance() are IMHO easier
understood than these library entry stuff.
You might dislike class, because it might be confused wit PHP classes.
But a library is a collection of functions and classes, so confusion
waits here as well.
BTW, you're aware that your constructors won't have any arguments? Not
that Typo3 uses constructors...
> This means:
> 1. you can have a default "object" or register errors when non-existent
> objects are created
> 2. you can have lots of classes supplying the same "class name"
> (libraryKey) - so for extensions you can have:
You don't really elaborate on how the loader should determine what class
should be instantiated. "user permissions" etc is a bit vague.
Idea: a "class" could mark itself as a singleton. This way the loader
can pass a reference to an existing object. Makes the static class
functions go away.
> I think this might be similar to servers...!
Talking about services? And yes, there are similarities.
Masi
More information about the TYPO3-dev
mailing list