[TYPO3-50-general] RFC: Short filenames
Robert Lemke
robert at typo3.org
Tue Jan 27 11:47:39 CET 2009
Hi Nino,
Am 27.01.2009 um 11:16 schrieb Nino Martincevic:
> As almost anyone of us I got this question some time ago, too.
> But if of your paradigms is to develop with "Intention Revealing
> Interfaces", there is no alternative for using good and meaningful
> names
> also for classes.
>
> Another question aside: You are using namespaces, why you additionally
> use PEAR-like file naming, technical restrictions?
>
> Robert Lemke wrote:
>> F3_FLOW3_MVC_Controller_ActionController.php -> ActionController.php
>
> Code that reads
> \Foo\Bar\Buh\Contact(...)->\Foo\Bar\Boo\Dispatcher(...)
> is simply not as intention revealing as
> BuhContact()->BooDispatch()->andReturn()
I was only referring to the filenames here, the class naming scheme is a
different topic.
So the question is: What should be the name of the file containing the
class \F3\Foo\Bar\Baz ?
a) F3_Foo_Bar_Baz.php
b) Baz.php
>> - doesn't give the full hint on the contents
>> (DefaultController.php ?)
>
> Thou who calls a class that way: Fire him!
Not possible. Open Source Project.
> It's equally criminal as to have a ...Manager, ...Handler, ...Process,
> ...Service etc. for class names. Except for generic or infastructural
> ones perhaps, but even then they (should) have a meaningful prefix:
> e.g. MyDefaultMVCController or MyAppBlogDefaultController.
>
>> - name conflicts / confusion when single files are deposited
>> temporarily on the desktop or elsewhere
>
> Coding discipline. Almost never happens with good namings (and IR
> again).
It happens all the time. Take ZF for example:
Zend/
Acl/
Assert/
Interface.php
Exception.php
Resource/
Interface.php
Resource.php
Role/
Interface.php
...
Role.php
Acl.php
..
Controller/
Action/
Exception.php
Helper/
HelperBroker/
HelperBroker.php
Action.php
...
FLOW3's directory structure would look like this:
Packages/
FLOW3/
Classes/
...
Cache/
Backend/
AbstractBackend.php
BackendInterface.php
FileBackend.php
MemcachedBackend.php
NullBackend.php
Exception/
NoSuchCache.php
...
Frontend/
AbstractFrontend.php
FrontendInterface.php
StringFrontend.php
VariableFrontend.php
Factory.php
Manager.php
...
>> - classes can't be found that easily anymore in Eclipse's resource
>> browser which uses filenames (go to "Navigate" > "Open Resource")
>
> Change your editor.
> No joke: if a software impedes me at my design work, I throw it our
> the
> window and better use a text editor.
Also no joke: If 99% of the software runs fine, I don't throw it away
and
work with notepad instead. So ...
Cheers,
robert
More information about the TYPO3-project-5_0-general
mailing list