Service Interfaces: Spring Data Rest and Spring MVC

As the first Independent Services of OpenLMIS v3 are taking shape we’re quickly coming to a cross-roads in terms of the technology pieces backing our adoption of RESTful interfaces. As we’ve progressed our thought process has been:

  • Broad HATEOAS adoption complicates legacy UI and mobile client API reuse. The ROI doesn’t appear to be very high.
  • Spring Data Rest (SDR) makes it easy to expose an entity through RESTful interfaces, however it’s very opinionated to HAL/HATEOAS representations
  • Explicitly designing, documenting and owning our service interfaces is critical in the new architecture to achieve modularity and re-use and therefore we’re in the process of adopting RAML to specify and document our interfaces in an implementation agnostic way. i.e. with SDR it’s difficult to remove SDR and still retain the interfaces our clients depend on. Utilizing RAML allows us to design interfaces less coupled to the backing technology.

As we’ve debated the pros/cons of SDR compared to RAML & Spring MVC, I think we’ve now arrived at pragmatic guidance on when SDR and MVC should be utilized. I’ve put that up on the wiki at:

Please take a look and let me know your thoughts here.