[TYPO3-dev] SOLUTION (?) : Multiple XCLASS inheritance
Michael Scharkow
mscharkow at gmx.net
Tue Feb 7 22:22:07 CET 2006
Peter Russ wrote:
> It's not based on an interface, it's "implement" an interface. So a
> class can extend a basic class and implements different interfaces to
> communicate with other classes. Just have a look at JAVA.
And please don't implement interfaces everywhere just because PHP5
offers it. Interfaces add a lot of useless complexity and
specification-ism, as does fanatic type casting. I agree that class
inheritance should be used in a lot of places, but the difficulty is
still in the factory function that needs to know what to instanciate.
> The question still exists: if a class A should be replaced by class B
> AND class C who wins? No problem as long as they extend different
> methods/functions. But replacing same functions would result in a "last
> one wins" situation.
Yes, and given that PHP does not support mix-ins (like e.g. Ruby), I
don't see any simple solution to that. Moreover, the code is very hard
to debug if half a dozen classes mess around in one base class.
I'd like to see XCLASSES disappear completely and only use hooks. TER
will be much cleaner after that ;)
Cheers,
Michael
More information about the TYPO3-dev
mailing list