[TYPO3-dev] Defending the XCLASS, proposing smaller classes

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Thu Feb 9 00:16:52 CET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

in the thread "SOLUTION (?) : Multiple XCLASS inheritance"  a lot of people
dammed the XCLASS. I guess that most of this people think in this pattern:

XCLASS = bad
service = good

The XCLASS is a strange construction in some way. I don't really want to defend
it. The idea is to extend a base class by inheritence.

On the other hand the concept of a service is to replace one class with another
in a pluggable way. But to say it clearly: The technology (not the idea) of
xclassing provides exactly this. It replaces one class with another in a
pluggable way.

So XCLASS is already a typical service. Although the name proposes it, I guess
there is no necessary at all, to inherit from the original class. You could
completly place another class in it's place. (I never tried this).

If XCLASS is nothing else than a strange way to build a service than there can
be no mayer disadvantages in comparism to other forms of services. So all the
conflicts that occour with XCLASS could occour with other forms of services in
the same way. It could be avoided with the same concepts as conflicts can be
avaoided (or not) with other services.

Some people propose Aspect Orientated Prgamming as a solution. I don't know much
of it. But if different Extensions would try to alter the same functions in a
class, I guess that the same conflicts will occour in a similar way.


To summerize:

Conflicts are rather a problem of the wrong usage ot the differnt technologies.
They can not be solved by simply changing the technologies. We must change our
habits to use the technologies.

One mayer problem is, that classes in TYPO3 are often to big. If a class is big
it is more likely that conflicts will result if different extensions try to
alter functions in it. The best way to reduce conflicts is to write smaller classes.



/el















-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD6nvkO976RNoy/18RAomjAJ98Usu6i4i6Kud1pOdgU/fNqxdBrQCfTtEd
BCjP/vDo6rHuFe0eEnDCcW8=
=BCde
-----END PGP SIGNATURE-----




More information about the TYPO3-dev mailing list