Limit compositions in a class
From CSSEMediaWiki
(Difference between revisions)
m |
|||
Line 1: | Line 1: | ||
+ | ---- | ||
+ | <div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"> | ||
+ | ---- | ||
+ | =[http://yjucofi.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]= | ||
+ | ---- | ||
+ | =[http://yjucofi.co.cc CLICK HERE]= | ||
+ | ---- | ||
+ | </div> | ||
:''Classes should not contain more objects than a developer can fit in his or her short term memory. A favorite value for this number is six.'' --Riel's Heuristic 4.7, [[Arthur Riel 1996]] | :''Classes should not contain more objects than a developer can fit in his or her short term memory. A favorite value for this number is six.'' --Riel's Heuristic 4.7, [[Arthur Riel 1996]] | ||
Revision as of 07:04, 24 November 2010
- Classes should not contain more objects than a developer can fit in his or her short term memory. A favorite value for this number is six. --Riel's Heuristic 4.7, Arthur Riel 1996
This heuristic assumes that most of the methods in a class should be using most of the data members most of the time. This will then require implementors to think about all the data members of the class while writing methods. If there are too many to think about, then this will lead to items being ommited and bugs creeping into the code. Seven plus or minus two is the widely accepted number of items that people can keep in their short term memory. Riel suggests that six is the optimum number as it takes into consideration those with poor short term memories and that there are other factors such as the fact that methods usually take in an argument or two.