of something that might be wrong. They are not rigid rules.
Your objects are a bunch of public attributes without behavior.
Photo by Stacey Vandergriff on Unsplash
Protocol is empty (with setters/getters).
If we ask a domain expert to describe an entity he/she would hardly tell it is ‘a bunch of attributes’.
<?
Class Window{
public height;
public width;
function getHeight(){
return $this->height;
}
function setHeight($height){
$this->height = $height;
}
function getWidth(){
return $this->width;
}
function setWidth($width){
$this->width = $width;
}
}
<?
final Class Window{
function area(){
//...
}
function open(){
//..
}
function isOpen(){
//..
}
}
#code-smells #clean-code #refactoring #refactor-legacy-code #stinky-code #stinky-code-parts #pixel-face #hackernoon-top-story