Object-oriented exercise is introduced in the book Thought Works Anthology. Nine rules that can improve software design are introduced. The good and bad of this rule is introduced in various places, so please refer to that.
Based on these, there is one big problem in actually practicing object-oriented exercise. There is no way to check how well they are compliant. Of course, you can check it visually, but it is very difficult to check all the programs, and the number of methods and the number of lines cannot be counted. On the contrary, since the rules themselves are firmly established, it should be possible to confirm them programmatically. When I searched for it, I couldn't find such a confirmation tool. So, it is a promotion that I tried to make a confirmation tool. In creating it, I practiced object-oriented exercise.
9rules
It is a tool published at https://github.com/tamada/9rules. It is a tool that targets Java source code and points out points that violate the nine rules of object-oriented exercise.
$ git clone https://github.com/tamada/9rules.git
$ cd 9rules
$ mvn package
$ java -jar target/9rules-1.0-SNAPSHOT.jar -h
java -jar 9rules.jar [OPTIONS] <ARGUMENTS...>
OPTIONS:
--strict: Strictly level check (Default).
--general: General level check.
--rough: Rough level check.
--help: Print this message and exit.
ARGUMENTS:
Directories include Java source files, and Java source files.
$ java -jar target/9rules-1.0-SNAPSHOT.jar src/main/java
Rule 5 Do not omit the name
is not implemented.Rule 6 Make all entities smaller
1 package 10 classes are not implemented.{}
`).
Therefore, try, catch, and closing parenthesis consume 3 lines, and the contents of the catch clause cannot be written in another line between try-catch.Recommended Posts