New answers tagged

2

As you are using Spring Boot, the best way to handle you response is to add a RestControllerAdvice. A few rules to follow : Create custom POJO to represent your custom message (you did it already) Return directly the response message in your controller, by setting the HttpStatus, here 2XX. You don't have to define your own HttpStatus, Spring Boot provides ...


3

common Interface classes that share the same behaviour should implement the same interface. That applies to Movie, Book and Song. Their interface is ReviewProvider: public interface IdProvider { long getId(); } public interface ReviewProvider extends IdProvider{ List<ReviewDocuments> getReviewDocuments(); } Refactoring implementing the ...


1

thanks for sharing your code. What I like Dependency Injection Naming according to the conventions use of JVM provided fuctionality (Collections.*()) what I'd improve OOP stuff Obsessive Interface creation At least the classe you shared here have Interfaces but only one implementation. On Top their Names only differ by the 'I' as first letter. This ...


Top 50 recent answers are included