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

From semantic-mediawiki.org
Jump to: navigation, search
Jeroen De DauwJeroen De Dauw/Static: The S in STUPIDUser:Jeroen De Dauw/Static: The S in STUPID/3

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