Spring 5.0 Projects
eBook - ePub

Spring 5.0 Projects

Build seven web development projects with Spring MVC, Angular 6, JHipster, WebFlux, and Spring Boot 2

Nilang Patel

Share book
  1. 442 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Spring 5.0 Projects

Build seven web development projects with Spring MVC, Angular 6, JHipster, WebFlux, and Spring Boot 2

Nilang Patel

Book details
Book preview
Table of contents
Citations

About This Book

Discover the latest features of Spring framework by building robust, fast, and reactive web applications

Key Features

  • Take advantage of all the features of Spring 5.0 with third party tools to build a robust back end
  • Secure Spring based web application using Spring Security framework with LDAP and OAuth protocol
  • Develop robust and scalable microservice based applications on Spring Cloud, using Spring Boot

Book Description

Spring makes it easy to create RESTful applications, merge with social services, communicate with modern databases, secure your system, and make your code modular and easy to test. With the arrival of Spring Boot, developers can really focus on the code and deliver great value, with minimal contour.

This book will show you how to build various projects in Spring 5.0, using its features and third party tools. We'll start by creating a web application using Spring MVC, Spring Data, the World Bank API for some statistics on different countries, and MySQL database. Moving ahead, you'll build a RESTful web services application using Spring WebFlux framework. You'll be then taken through creating a Spring Boot-based simple blog management system, which uses Elasticsearch as the data store. Then, you'll use Spring Security with the LDAP libraries for authenticating users and create a central authentication and authorization server using OAuth 2 protocol. Further, you'll understand how to create Spring Boot-based monolithic application using JHipster. Toward the end, we'll create an online book store with microservice architecture using Spring Cloud and Netflix OSS components, and a task management system using Spring and Kotlin.

By the end of the book, you'll be able to create coherent and flexible real-time web applications using Spring Framework.

What you will learn

  • Build Spring based application using Bootstrap template and JQuery
  • Understand the Spring WebFlux framework and how it uses Reactor library
  • Interact with Elasticsearch for indexing, querying, and aggregating data
  • Create a simple monolithic application using JHipster
  • Use Spring Security and Spring Security LDAP and OAuth libraries for Authentication
  • Develop a microservice-based application with Spring Cloud and Netflix
  • Work on Spring Framework with Kotlin

Who this book is for

This book is for competent Spring developers who wish to understand how to develop complex yet flexible applications with Spring. You must have a good knowledge of Java programming and be familiar with the basics of Spring.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Spring 5.0 Projects an online PDF/ePUB?
Yes, you can access Spring 5.0 Projects by Nilang Patel in PDF and/or ePUB format, as well as other popular books in Informatik & Programmierung in Java. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781788391979

Task Management System Using Spring and Kotlin

In the chapters so far, we have explored various topics and concepts in depth. Starting with the pure Spring Framework and moving onto Spring Boot, we learned how quickly and easily we can create an enterprise-grade application with Spring Boot.
We also learned about the integration of the Spring Framework with other tools and technologies, such as Elasticsearch, LDAP, and OAuth, within the purview of the Spring Boot context. We then learned a new way of creating an application with Spring as a backend and Angular as a frontend with a tool called JHipster.
Then, we discovered how to create an application with modern architecture in the dimension of the distributed environment called microservice. In this chapter, we go further and explore a completely different dimension of the Spring Framework, looking at how it is supported by a new programming language called Kotlin.
As a programming language, Kotlin has quickly become popular among developers and companies. The first stable version of Kotlin was released officially in 2016. The very next year Google officially declared Kotlin as a supported language for mobile development on an Android platform. This greatly increased the popularity and adoption rate of Kotlin.
Starting with version 5, Spring announced support for Kotlin to develop enterprise applications on a Spring Framework. In this chapter, we will explore how to develop a Spring-based application with Kotlin. We will build an application called Task Management with Spring Boot and Kotlin, and will cover the following:
  • Introduction to Kotlin
  • Basic features of Kotlin as a programming language
  • Kotlin versus Java
  • Spring support for Kotlin
  • Developing a Task Management application in Spring with Kotlin

Technical requirements

All the code used in this chapter can be downloaded from the following GitHub link: https://github.com/PacktPublishing/Spring-5.0-Projects/tree/master/chapter07. The code can be executed on any operating system, although it has only been tested on Windows.

Introducing Kotlin

Kotlin is a language for Java Virtual Machine (JVM) and hence can be used in place of Java. Be it server side, mobile, or web, you can use Kotlin everywhere Java is used at present. It is sponsored by a company called JetBrains; it is open source, and you can download the source code from GitHub (https://github.com/jetbrains/kotlin). They plan to roll out Kotlin for embedded and iOS platforms in the near future.
Kotlin provides good support as a functional programming language. The term functional programming is used to describe a declarative paradigm where the program is created by an expression or declaration rather than by the execution of commands. The functional programming model inherently brings certain qualities to the application, such as more compressed and predicted code, easy testing ability, reusability, and so on. Kotlin brings a functional paradigm in the form of inbuilt features.
There are many similarities between Java and Kotlin, and so the question arises, why do we need another programming language when Java has been widely used and very popular for more than two decades. The answer lies in some of the cool features Kotlin has, which make it the better choice for developing JVM-based applications.

Interoperability

One of the most promising features of Kotlin is its interoperable capabilities. Kotlin is 100% interoperable with Java. The application can combine both the languages. The call to Java libraries can be made from Kotlin without any conversion or fuss. Similarly, code written in Kotlin can also be called from Java with ease. This greatly helps Java developers to migrate from Java to Kotlin without any difficulty.
Migrating a code from one programming language to another is a quite tedious and time-consuming task, especially when those programming languages are incompatible, in terms of rules, syntax, features, and so on. Although there are a bunch of features available in Kotlin that are not present directly or indirectly in Java, it is the interoperability of Kotlin that allows running the code with both programming languages simultaneously. You do not have to migrate all Java code to Kotlin. Kotlin's Interoperability is shown in the following diagram:
On top of this, the Kotlin standard library is dependent on the Java Class Library, which enables reusing the dependencies, and no code refactoring is required in any of the places. For example: Kotlin's collection framework is built on top of Java's collection API.

Concise yet powerful

While working with Kotlin, you will find another good quality is how concise it is. The Kotlin syntax is easy to read and interpret even without prior knowledge of any programming language. Kotlin has certain features that make it a truly concise language, such as type interface, data classes, properties, smart casts, and a lot more. We will see more detail about each of them later in this chapter.
With these features, the code written with Kotlin is compact without losing its capabilities. Kotlin is more concise than Java in many aspects, and because of this we can implement the same functionality with fewer lines of code. This greatly improves legibility and ease of use. Developers can easily read, code, and update the program, even when it h...

Table of contents