Refactoring: Remove Setters #CodeSmellby@mcsee

Refactoring: Remove Setters #CodeSmell

tldt arrow
Read on Terminal Reader🖨️

Too Long; Didn't Read

Make your attributes private to favor immutability and add accidental coupling. Setters violate good naming policies since it does not exist on the [MAPPER] setXXX(). Remove the setXXX prefix. If you need to change an accidental property it is not a setter. Remove setXXX. Setter.setX(1); SetXXX(1) violates good naming policy. Setters should detect setters (unless they use meta-programming). Setters must also have good coverage if the car stores its new speed.

People Mentioned

Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Refactoring: Remove Setters #CodeSmell
Maximiliano Contieri HackerNoon profile picture

@mcsee

Maximiliano Contieri

About @mcsee
LEARN MORE ABOUT @MCSEE'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa