[Typo3-dev] Colliding extensions

Michael Zedeler michael at zedeler.dk
Fri Jan 16 10:21:07 CET 2004


Hi Martin,

Martin Poelstra wrote:

>>- 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)

That is just good, old OO programming that cannot really fail.
 > [cut]

> 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').

The only way to do it is to create a way that extensions can be loaded 
independently and without ambiguity. Letting the administrator of the 
site choose wich modules that should override which will lead to a lot 
of problems, since the admins wont nessecarily know the internals of the 
modules thay want to load and because conflicts may be impossible to 
resolve without loosing acces to methods that are needed for the system 
to work.

> 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.

Otherwise one could merge it with the main distribution for now. And 
then split it off when a more generic module loader is in place.

The module you are working on should be able to work if it was loaded 
with the namespace separation method, right?

Regards,

Michael.




More information about the TYPO3-dev mailing list