[Typo3-dev] extending extensions

Michael Zedeler michael at zedeler.dk
Fri Jan 16 01:28:20 CET 2004


Boris Nicolai wrote:

> morning,
> I run into serious trouble as I want to develop another ext which extends
> the tslib_fe.
> the problem is as already sometimes discussed, what if I want to install two
> ext that extend tslib_fe (or whichever class)?

I don't quite see the problem. Extending a class is done by simple 
inheritance. It must be instantiation that is the problem.

> so I thought a bit and maybe I got a solution without the time to develop it
> :(
> A basic-class could look if there are classes that extend this class. if so,
> the basic-class creates an instance of this XCLASS, and if a function of the
> basic-class is called then the basic-class checks if this function doesn't
> exist in one of its extension-classes.  [...cut...]

It sounds like there is a problem deciding what class to instantiate in 
a given context. This sort of problem is generally solved using the 
factory design pattern.

http://gsraj.tripod.com/design/creational/factory/factory.html

Regards,

Michael.




More information about the TYPO3-dev mailing list