5. Conclusion
We built the following client/server application:

To arrive at the final version of the code, we had to explain many aspects of the AngularJS and Spring 4 frameworks. This document can therefore be used to learn how to use these two frameworks. Section 1.3 explains where to find the code and how to use it.
We have demonstrated that the client/server application is usable in various environments:
- as a traditional web application;
- as an executable binary on Android emulators;
Once again, this tutorial is not exhaustive in its coverage of the two frameworks. For Angular, we would certainly need to cover the testing tools that accompany it. Testing is an essential step when writing an application. The tools associated with Angular allow for automating these tests and incorporating them into a continuous integration process.
From this work, I’ll take away two key points:
- Writing the Spring web service was moderately complicated. From the start, I was familiar with Spring’s concepts. I only encountered difficulties with securing the web service and later with managing CORS HTTP headers—two areas I was unfamiliar with;
- Writing the Angular client was much more complex for several reasons:
- I lacked sufficient knowledge of the JavaScript language and its capabilities;
- I had trouble understanding how asynchronous programming works within the browser. I was thinking of it as on a server, where this asynchrony is achieved through the simultaneous use of multiple threads. In the browser, there is only one thread, and asynchronous tasks are processed sequentially rather than in parallel. More specifically, asynchronous tasks can run in parallel (multiple HTTP requests, for example), but the events they trigger upon completion are processed sequentially. There is therefore no concurrent execution to manage, along with the many issues that come with it;
- Angular is a rich framework with many concepts (MVC, directives, services, model scope, etc.). It takes a long time to learn;
- Angular does not impose a specific development method. Thus, to achieve the same result, one can use different architectures. This is confusing. I am more comfortable with closed frameworks where everyone uses the same design patterns. I have therefore constantly sought to replicate the design patterns I use on the server side. I am satisfied with the result because I believe it is reproducible. That is what I was looking for. But I have no idea whether or not I have strayed from Angular’s “best practices”;
Serge Tahé, July 2014.