Chapter 10. Beyond Spring Web

In this chapter, we'll see how far we have come, the problems we've solved, and the ones left to be addressed.

We will talk about the Spring ecosystem in general, and persistence, deployment, and Single Page Applications in particular.

The Spring ecosystem

From the Web to data, Spring is a comprehensive ecosystem aiming to resolve all sorts of problems in a modular way:

The Spring ecosystem

Check out the Spring IO platform at https://spring.io/platform.

Core

At the core of the Spring framework, there is obviously a dependency injection mechanism.

We only scratched the surface of the security features and the great integration of the framework with Groovy.

Execution

We saw in detail what Spring Boot is about -- bringing simplicity and cohesion to a vast network of subprojects.

It allows you to focus on what really matters, that is, your business code.

The Spring XD project is also really interesting. Its goal is to provide tools to process, analyze, and transform or export your data, and has a clear focus on big data. For more information, visit http://projects.spring.io/spring-xd.

Data

One of the things we haven't looked at while developing our application is how to store data in a database. In Pivotal's reference architecture, there is a tier devoted to both relational data and non-relational (NoSQL) data.

The Spring ecosystem has provided a lot of interesting solutions under the label spring-data, which can be found at http://projects.spring.io/spring-data/.

We glanced at Spring Data Redis when we built the cache but there is much more to Spring Data.

The basic concepts are shared among all the Spring Data projects, such as the template API, which is an abstraction to retrieve and store objects from a persistence system.

Spring Data JPA (http://projects.spring.io/spring-data-jpa/) and Spring Data Mongo (http://projects.spring.io/spring-data-mongodb/) are some of the most well known Spring Data projects. They let you operate on entities through repositories, simple interfaces that provide facilities to create queries, persisting objects, and so on.

Petri Kainulainen (http://www.petrikainulainen.net/spring-data-jpa-tutorial/) has a lot of thorough examples on Spring Data. It does not use the facilities that Spring Boot provides but you should be able to get started quite easily with guides, such as the one available at https://spring.io/guides/gs/accessing-data-jpa/.

Spring Data REST is also a magical project that will semiautomatically expose your entities through a RESTful API. Visit https://spring.io/guides/gs/accessing-data-rest/ for a detailed tutorial.

Other noteworthy projects

Spring Integration (http://projects.spring.io/spring-integration) and Spring Reactor (http://projectreactor.io) are also two of my favorite Spring projects.

Spring Reactor is the implementation of reactive streams by Pivotal. The idea is to provide fully nonblocking IO on the server side.

Spring Integration, on the other hand, focuses on Enterprise Integration Patterns and lets you design channels to load and transform data coming from heterogeneous systems.

A good, and simple, example of what you can accomplish with channels can be seen here: http://lmivan.github.io/contest/#_spring_boot_application.

If you have heterogeneous and/or complex subsystems with which your application has to communicate, it is definitely worth taking a look at.

The last project in the Spring ecosystem we haven't is Spring Batch, a really useful abstraction for processing high volumes of data for the daily operations of enterprise systems.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.188.138