[TYPO3-dev] t3lib_div - why final ?

Dmitry Dulepov [typo3] dmitry at typo3.org
Thu Mar 27 10:14:08 CET 2008


Hi!

Stefan Geith wrote:
> Looked from the other side, you could also say:
> There seems to be no need to make t3lib_div final.

There is. You are not expected to extend static classes!

> I use this in development.
> I wanted to have one single class that handles all
> these little helpers as t3lib_div does; so I extended it.

Why can't you use t3lib_div in your class? Why extend it?

> For testing, I sometimes modified existing function
> to contain debug-statements without disturbing the core
> and/or other extension, that use the original t3lib_div.

For testing you can modify the source file (class.t3lib_div.php).

> There might be other applications, where it is usefull
> to extend t3lib-classes; maybe for testing / developpment etc...

You can extend non-static classes but not static ones. You are expected to use them as is and create your own classes. May it was not in CGL but I think it is a general opinion.

> Can you give me an example, why it would be better to
> have t3lib-classes to be final?

Not all, only static.

-- 
Dmitry Dulepov
TYPO3 core team
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"Nothing is impossible. There are only limits to our knowledge"




More information about the TYPO3-dev mailing list