Java is the most widely used programming language that runs on Java Virtual Machine (JVM). There are many other JVM-based languages, such as Groovy, Scala, JRuby, Jython, Kotlin, etc. Among them, Groovy and Scala are widely adopted and very popular among the Java community and Kotlin adoption is growing very rapidly.
Data persistence is a crucial part of software systems. Most software applications use relational databases as datastores but recently NoSQL data stores like MongoDB, Redis, Cassandra are getting popular too. Java provides JDBC API to talk to the database, but it is a low-level API that requires lots of boilerplate coding. The JavaEE platform provides the Java Persistence API (JPA) specification, which is an Object Relational Mapping (ORM) framework. Hibernate and EclipseLink are the most popular JPA implementations. There are other popular persistence frameworks, such as MyBatis and JOOQ, that are more SQL focused.
MyBatis is an open source Java persistence framework that abstracts JDBC boilerplate code and provides a simple and easy-to-use API to interact with the database.
This chapter takes a more detailed look at Spring Boot and its features. Then the chapter looks at various options of creating a Spring Boot application, such as the Spring Initializr, Spring Tool Suite, Intellij IDEA, etc. Finally, the chapter explores the generated code and looks at how to run an application.
REST (REpresentational State Transfer) is an architectural style for building distributed systems that provide interoperability between heterogeneous systems. The need for REST APIs increased a lot with the drastic increase of mobile devices. It became logical to build REST APIs and let the web and mobile clients consume the API instead of developing separate applications.
The Spring framework is a very popular and widely used Java framework for building web and enterprise applications. Spring at its core is a dependency injection container that provides flexibility to configure beans in multiple ways, such as XML, Annotations, and JavaConfig. Over the years, the Spring framework grew exponentially by addressing the needs of modern business applications like security, support for NoSQL datastores, handling big data, batch processing, integration with other systems, etc. Spring, along with its sub-projects, became a viable platform for building enterprise applications.
Learn Spring Boot and how to build Java-based enterprise, web, and microservice applications with it. In this book, you'll see how to work with relational
MongoDB is one of the most popular document-oriented NoSQL databases. Spring Data MongoDB provides support for working with MongoDB with a consistent Spring-based programming model similar to Spring Data JPA. Spring Boot provides a starter for Spring Data Mongo, which makes it even easier to use by implementing its autoconfiguring mechanism.
Security is an important aspect of software application design. It ensures that only those who have authority to access the secured resources can do so. When it comes to securing an application, two primary things you'll need to take care of are authentication and authorization. Authentication refers to the process of verifying the user, which is typically done by asking for credentials. Authorization refers to the process of verifying whether or not the user is allowed to do a certain activity.