1 of 6

Google Summer of Code 2019 with

InterMine

Web-Services Migration Project

by

Prabodh Kotasthane

Primary Mentor: Daniela Butano

Backup Mentor: Julie Sullivan

2 of 6

Project Overview

  • InterMine provides RESTful web-services which facilitates to execute custom or templated queries, search keywords, manage lists, discover metadata, perform enrichment statistics and manage user profiles.
  • Presently, the webapp is based on struts framework, which is outdated, and the web-services are based on http servlet-service architecture.
  • The main objective of this project is to migrate the web-services from Struts to Spring framework and document the APIs with Swagger in compliance with OpenAPI Specifications.

3 of 6

Why Migrate to Spring?

  • Struts is old and outdated, and no longer supported.

  • Earlier we had a long xml file for configuration and metadata of the web services.

Now we have much less code as Spring Boot handles most of the configuration and the documentation of web-services is linked to the APIs of the respective web services using Spring annotations.

  • Spring is flexible and easy to understand. We can have custom ResponseEntity output objects serialized into any format that we want. This helps in removal of some unwanted classes such as Output classes and some Formatters. Also, use of annotations make the code look much cleaner and simpler to understand.

  • Other features of Spring like Spring’s Model View Controller (MVC), which is highly flexible and configurable according to our custom needs, can be used while migrating the webapp from Struts to Spring.

4 of 6

Annotations in yellow

Documentation linked to APIs

5 of 6

Workflow of Migration

  • The webapp was split into independent webapp gradle project and web-services gradle project by Daniela.
  • Then I converted the Struts based web-services project to a Spring Boot gradle project.
  • Took web-services from xml file and wrote Open API specifications using Swagger Editor.
  • Using the specifications and Swagger Codegen, generated code skeletons, which contains well documented API classes and Spring controllers which are counterparts for the current servlets.
  • Added the above code stubs into our Spring Boot project and integrated it with the existing business logic of web-services.
  • Removed the classes which are no longer required by virtue of Spring. Also, made the code more understandable by use of Spring supported annotations.
  • Functionally testing the code using Swagger UI.

6 of 6

Thank you!