Created
July 13, 2015 15:56
-
-
Save 1UnboundedSentience/2033c186d19b5ea78e9e to your computer and use it in GitHub Desktop.
POODR Ch2 Ch3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Messages are the foundation of OO, but classes are the most visible org structure. You must decide what your classes are, how many, behavior, how much they know about other classes, how much they expose. Group methods into classes. How you decide will forever influence how you think of your application. | |
Good princpiple is to allow for "easy changes": meaning | |
-changes have no side effects | |
-small changes in req require small change sin code | |
-code easy to reuse | |
TRUE - transparent, reasonable, useable, exemplary - | |
If something has both data and behavior (the gears on a bike have chainrigs, cogs, ratios) there should be a separate class for it, assuming modelling wheel size vs distance travelled is important. | |
SRP - class must fulfill its purpose | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment