Are getters and setters poor design? Contradictory advice seen [duplicate]
问题 This question already has answers here : Why use getters and setters/accessors? (38 answers) Closed 4 years ago . I\'m currently working on a simple game in Java with several different modes. I\'ve extended a main Game class to put the main logic within the other classes. Despite this, the main game class is still pretty hefty. After taking a quick look at my code the majority of it was Getters and Setters (60%) compared to the rest that is truly needed for the logic of the game. A couple of