Public:Class code sections
From YaddaWiki
(Difference between revisions)
(Created page with "= Class code sections = To improve the readability of classes we have decided to divide their code into logical sections. Each section has a relevant comment block on top of it.…") |
(→Class code sections) |
||
Line 1: | Line 1: | ||
= Class code sections = | = Class code sections = | ||
- | To improve the readability of classes we have decided to divide their code into logical sections. Each section | + | To improve the readability of classes we have decided to divide their code into logical sections. Each section should have a relevant comment block on top of it. |
The comment pattern for each section is as follows: | The comment pattern for each section is as follows: | ||
Line 7: | Line 7: | ||
//------------------------ SECTION_NAME -------------------------- | //------------------------ SECTION_NAME -------------------------- | ||
- | Names of all distinguished code sections | + | Names of all distinguished code sections along with their descriptions: |
* CONSTRUCTORS - class constructors | * CONSTRUCTORS - class constructors |
Latest revision as of 08:26, 20 August 2018
Class code sections
To improve the readability of classes we have decided to divide their code into logical sections. Each section should have a relevant comment block on top of it.
The comment pattern for each section is as follows:
//------------------------ SECTION_NAME --------------------------
Names of all distinguished code sections along with their descriptions:
- CONSTRUCTORS - class constructors
- GETTERS - Java Beans getters
- TESTS - test methods in test classes
- LOGIC - public methods of a class that implement its intended functionalities, e.g. Parser.parse(String) or Math.divide(), Court.addDivision(Division).
- PRIVATE - class and package private methods
- SETTERS - Java Beans setters
- HashCode & Equals - hashCode and equals methods
- toString - toString method
- INNER CLASSES - inner classes
The order of the sections in a class should be the same as on the list above.