[Typo3-dev] Colliding extensions (was: extending extensions)

Martin Poelstra martin at beryllium.net
Fri Jan 16 10:08:48 CET 2004


Hi Kasper, list,

> - Extension to classes was meant as LOCAL changes one can make to specific websites or local installations so that you can still update the TYPO3 source and keep backwards compatibility.
> - Extension to classes should NOT be used in extensions in long-term - only shortterm fixes until an API that allows to connect to a given functionality has been integrated. 

That's what I was just going to say :)
For the majority of extensions the multiple-extensions-problem doesn't
exist, because you're either:

- extending an extension, that's not a problem, because you actively
extend the right extension, instantiate the right one and can control
the 'stacking' of individual functions in the classes (by calling
parent::foo() before or after your own code)
- creating a new content-element, backend-module, etc. There's a good
API for such things, which makes it possible for many classes to
co-exist, each with their own namespace

It goes wrong when you need to have some functionality in the
Typo3-core, and there isn't an API for it yet.
This problem arises for example with the Speaking URI's.

I think there are currently two possible solutions for this problem:
1. Create a very advanced, very complex and still pretty dangerous
dynamic class loader with automatic stacking
2. Wait for a new API to be created for your functionality and use the
current extension-way in the mean time

The first solution is more general, but I think it can make life real
hard when things go wrong, and it's a lot of work to implement it right.
The second solution will in the end give the most elegant solution, but
requires changes to the core over and over again (to create the new
'APIs').
Let's take a look at my RealURL-extension (for speakingURIs):

I started coding using the current XCLASS-extension-method. There's no
API for what I want yet. This version works for all Typo-versions, but
will give problems if some other extension needs to extend (probably a
very different part of) e.g. tslib_fe.
Now assume I talk to the Typo3-core team, and they decide to create some
API to generate URLs in general.
I then have to modify my extension to use the new scheme instead, which
is much more elegant and probaly provides the needed functionality in an
easier way then before. I decide to not maintain the 'old' code, because
that's just a now depricated method.
So, if you now want to use this new extension you are forced to upgrade
to the latest version of Typo.

Is this a real problem for many of us? If not, I'd suggest we use the
second approach, because it a) doesn't happen too much (or does it?) and
b) is relatively easy and c) will give the most elegant code in the end.

Grtz,
Martin






More information about the TYPO3-dev mailing list