ARCHITECTURE “One of the great bugaboos of software applications over the years has been infiltration of business logic into the user interface code.” -- Alistair Cockburn http://alistair.cockburn.us/Hexagonal+architecture
LAW OF DEMETER “The Law of Demeter for functions states that any method of an object should call only methods belonging to itself, any parameters that were passed in to the method, any objects it created, and any directly held component objects. ”
HOW DO YOU TEST THIS? class HipsterApi { ! public function getBands() ! { ! ! return $this->_call('/api/bands', $this->_apiKey); ! } } class HipsterApiWrapper { ! public function __construct($hipsterApi) ! { ! ! $this->_hipsterApi = $hipsterApi; ! } ! public function getBands() ! { ! ! return $this->_hipsterApi->getBands(); ! } }