[Typo3-dev] singletons instead of pre-loaded objects
Leendert Brouwer [Netcreators]
leendert at netcreators.nl
Tue Aug 10 16:51:46 CEST 2004
"Kasper Skårhøj" <kasper2004 at typo3.com> wrote in message
news:mailman.44.1092050125.6390.typo3-dev at lists.netfielders.de...
> I think the suggestion shall be seen more as a future framework for the
> increasing number of core/extension developers which like OO more than
> me. Personally, I'm kind of "lost" in this regard. I have my coding
> style and will not change it just for fun, only if there are something
> real to gain.
>
> - kasper
There is something real to gain. The advantages OO (and related concepts)
has to offer :) Especially in a highly extendable system such as TYPO3, a
proper design and seamless communication is essential, imho. If you take a
look at those 2 points:
- proper design
In its true OO meaning, this would mean that an object represents only what
it should represent, and that what it represents is factored properly enough
to be able to read, maintain and override its functionality. Not currently
the case, imho. Or else overriding user authentication logic would be a
breeze, for instance. Classes as they are now can be factored to many
smaller classes, with names that would all make sense. It'd make it easier
to override small parts of TYPO3's functionality, which I often find myself
doing. It would also make it easier to apply disciplines such as unit
testing (especially common in the extreme programming world). This would
make for great quality assurance possibilities. However, I also understand
that this would implicate a rewrite of the TYPO3 core which would require a
huge amount of effort. It was just never really refactored into that
direction along the way, it seems (wasn't there from the beginning, can't
tell).
- seamless communication
OO knows a large vocabulary of terminology. This vocabulary has practical
use - communication. It is easy to communicate when you can speak about
patterns. A pattern name can be seen as a label for a certain
implementation. When developers would speak about an "Active Record" for
instance, that would imply an implementation of the Active Record pattern
( http://www.martinfowler.com/eaaCatalog/activeRecord.html ), so everybody
would immediately know what is going on (maybe at most pointing to a
resource where the pattern is defined). When I look at the source sometimes
now, I just get dizzy :)
Anyway, yes, it's a huge amount of effort with no practical gain for the end
consumer directly (in the long run maybe, when the development process
starts to create opportunities).
More information about the TYPO3-dev
mailing list