タグ

oopとbenchmarkに関するrestartrのブックマーク (1)

  • Static call versus Singleton call in PHP

    Introduction In the past several months I’ve been working with a rather large application built with symfony. I noticed that symfony makes heavy use of the Singleton pattern (other frameworks, like Zend do that too); everywhere in the code there were pieces like this one: <?php // ... sfSomething::getInstance(); // ... ?> I know that in more than half of the situations, you can write your code usi

    Static call versus Singleton call in PHP
    restartr
    restartr 2010/03/03
    結局言いたいことは、HipHop早いよね、ということか。 StaticCall / Singleton は用途次第かな。必ず初期化したいことを隠蔽して使うのがSingleton. Static callはそのメソッド単体で完結するもの。static call内部でstatic callしてたら気持
  • 1