Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualHodgman

Posted 07 October 2012 - 08:54 PM

A well designed class should have very few "reasons to change". If you've got a class with 100 different functions that change it's state in different ways, then that's a sign that your class can probably be broken up into many smaller classes. See SRP.

If you do have a class that needs to have a lot of accessible/modifiable attributes, consider just using a struct with public data members and no functions.

#1Hodgman

Posted 07 October 2012 - 08:53 PM

A well designed class should have very few "reasons to change". If you've got a class with 100 different functions that change it's state in different ways, then that's a sign that your class can probably be broken up into many smaller classes. See SRP.

If you do have a class that needs to have a lot of getters and setters consider just using a struct with public data members and no functions.

PARTNERS