I "herited" a lot of Spring Boot code which is basically an asortment of REST Webservices. All those webservices are separated into an interface and an implementation and I find it hard get a grasp of which method is doing what and change an implementation.
The interface usually looks like this:
@RequestMapping(value = "/getfoo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody ResponseEntity<Metadata> getMetadata(
@RequestParam(value = "Id", defaultValue = "") Long id);
The implementation is basically a copy of the interface:
public @ResponseBody ResponseEntity<Metadata> getMetadata(
@RequestParam(value = "Id", defaultValue = "") Long id)
The part I consider annoying the most is that the implementation lacks the URL from the RequestMapping
and I have to jump back and forth between declaration and implementation.
Eclipse provides support to ease this but it is a waste of time.
I consider flattening the design and removing the interface. Is this a bad idea ?