User:Jeroen De Dauw/Static: The S in STUPID/3

From semantic-mediawiki.org

The S in STUPID

Tight coupling!

Problem #2:

  • What if the caller wants to use a different logger?
public function doStuff() {
    // ...

    Logger::log( 'doing stuff during caturday is madness' );

    // ...

    DataStore::saveObject( $object );

    // ...
}
  • Logger::log and DataStore::saveObject are ALWAYS called