Thank you for sharing! One point which is rather about code convention, - you don't need to prefix with `this` when calling finder methods on a repository instance in the controller:
```
this.repository.findAll(...)
```
It's getting too noisy to read the code and the compiler will do it for you. Usually, you should use it only when assigning a new value.
I'd say that the term itself "Microservice framework" is totally wrong. You can provide an API using this or another language (Java, Go etc.). Why not mention Ruby or Elixir for example, - both can be used in mode API at ease.
1. I don't see the need to call `super` in the abstract class `Customer`.
2. You should use either a threshold value to get more accuracy or even better use BigDecimal with compareTo() method to compare 2 double values, never use just '=='.
If we consider that calling a method is as if we are sending a message, in this case used methods names (accept, visit) are so cumberscome and just bring the ambiguity.
It is a little bit outdated to create a Maven-aware project like that (create a testrest folder, then src/main/java folder, etc.). As in the very beginning you were using Eclipse IDE, why not just ask Eclipse to create an empty Maven project ? In this case you don't need to run mvn eclipse:eclipse any more.
It seems like some dependencies are missing (slf4j):
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Comments
Aug 09, 2023 · Otavio Santana
Thank you for sharing! One point which is rather about code convention, - you don't need to prefix with `this` when calling finder methods on a repository instance in the controller:
```
this.repository.findAll(...)
```
It's getting too noisy to read the code and the compiler will do it for you. Usually, you should use it only when assigning a new value.
Jun 02, 2021 · Ravi Kiran Mallidi
I'd say that the term itself "Microservice framework" is totally wrong. You can provide an API using this or another language (Java, Go etc.). Why not mention Ruby or Elixir for example, - both can be used in mode API at ease.
Oct 23, 2020 · Brijesh Saxena
Thank you for sharing. Two points though:
1. I don't see the need to call `super` in the abstract class `Customer`.
2. You should use either a threshold value to get more accuracy or even better use BigDecimal with compareTo() method to compare 2 double values, never use just '=='.
Jul 30, 2020 · Mike Gates
I think you don't need to annotate name attribute with
as it will be the same by default, - use it only if the JSON attribute name is different from Java one.
May 23, 2020 · Blake Ethridge
So true and applied to the current team and project I joined since 4 months.
May 05, 2020 · Saša Starčević
Thank you very much for sharing, really useful!
Dec 28, 2017 · Mike Gates
Thank you for sharing, Sebastian ! It would be great to indicate the type of git variable in the the following expresion:
Regards
Aug 09, 2017 · Per-Åke Minborg
Thank you for sharing ! Sure, Java has still a long way to go to get more readability compared to Ruby for example.
Aug 01, 2017 · James Sugrue
If we consider that calling a method is as if we are sending a message, in this case used methods names (accept, visit) are so cumberscome and just bring the ambiguity.
Nov 30, 2016 · Unni Mana
yep, correct :)
Nov 30, 2016 · Unni Mana
Ar least the last 3 versions have it.
Nov 30, 2016 · Unni Mana
It is a little bit outdated to create a Maven-aware project like that (create a testrest folder, then src/main/java folder, etc.). As in the very beginning you were using Eclipse IDE, why not just ask Eclipse to create an empty Maven project ? In this case you don't need to run mvn eclipse:eclipse any more.
It seems like some dependencies are missing (slf4j):
mvn exec:java -Dexec.mainClass="com.controller.HelloRest"
I got the below error:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.