class | a domain model if you have to store or manipulate instances of it in order to implement a requirement | a comment at the top describing the purpose of the class, how it should be used, its authors and its history of modification | the unit of data abstraction in an object-oriented program | | | 9.2 - Principles Leading to Good Design | the pieces of data that describe some entity, so that programmers can manipulate that data as a unit | | the details of data | to hold a responsibility if the responsibility cannot be attributed to any of the existing classes | | variables | A software module that provides both procedural and data abstraction. It describes a set of similar objects, called its instances | methods | a programmer to cope with the complexity of data | | | | several similar objects | the internals of a computer system such as 'Record', 'Table', 'Data', 'Structure', or 'Information' | a list of variables, called instance variables, corresponding to data that will be present in each instance | a box with the name of the class inside in a UML class diagram | | data associated with each object | class^2 |
comment | | | between about 20% and 35% of the total length of the code | obvious things since they add clutter | the top of each class | Programming Style Guidelines | | the purpose of the class, how it should be used, its authors and its history of modification | | | to describe the purpose of each class, method and variable along with any difficult-to-understand statements inside methods, and to indicated any changes to the code | | | | | | to describe loops and conditional statements inside complex algorithms | writing the code | | | | | | | |