Closed zak905 closed 7 years ago
I've pretty much but a ghetto REST framework in place. If you check the RosterService.class it pretty much reads the uri and direct traffic to the appropriate method using a switch statement. I think putting in a "real" REST framework would be costly and overkill.
So, I have added a Rest service so that we can test. You can find it at: https://github.com/titanae/schooliki/blob/maven/schooliki-server/src/main/java/net/videmantay/rest/AppUserService.java I have tested it for the creation of an AppUser, and the response time is almost instantanious. I have not hooked it to the front end yet, I just tested it using Postman, which is a Google Chrome app for testing HTTP calls.
This is done. Jax-Rs Jersey was used for this purpose
This is another suggestion to improve the backend of the application. In modern web application (not only GWT), usually all the routing and the logic is shifted to the front end, and the back end has the role of supplying the data only. This results in a much faster and responsive application. Plus the application can leverage caching in the browser, so the response time is almost instantaneous. The REST standard usually follows the following pattern for resources: let's say we want to design the end point for user:
Here is a more detailed guideline: https://codeplanet.io/principles-good-restful-api-design/ and this can be done for all resources. There are several frameworks that can make implementing a REST backend easy such as JAX-RS ( which part of Java ) and Spring MVC. This is again not mandatory, but It can be beneficial for the application.