Johannes Reichardt <johannes.reicha...@googlemail.com> hat am 30. Oktober 2012
um 16:37 geschrieben:
> > In times of testability and several design patters, the use of static calls
> > is
> > really outdated.
> > I understand that you can read and write the invocations of the methods much
> > faster, but you should think more to the future on that point.
> I am not sure if that is true for TURBOPY. It has been "organically
> grown" over the years
> and I had no scenario where I needed instances. The benefit of more
> compact code is worth
> it for this scenario I think. The nature of a server request is still
> very procedural.
Yeah, but when thinking of your TURBOPY as an application, you will come to a
point where changes are neccessary,
They stopped programming procedural PHP for a reason. And they introduced things
like DIC for a reason.
If you want to make sure that your framework works even after changing or adding
somethink, you have to think about phpunit for example.
And if you think about add-ons or mods to your basic classes, you will consider
design patterns that are incompatible with static usage.
If your code will run a longer living CGI process for example, then you will
have to take care that all static members are resetted, otherwise the next user
gets them. That's where objects kick in.
think about it, if you want to make TURBOPY ready for the future.
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3
Tel.: 0174 / 9722336
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php