Spring

Spring Boot: Building a RESTful Web Application

Introduction: REST stands for Representational State Transfer and is an architectural guideline for API design. We assume that you already have a background in building RESTful APIs. In this tutorial, we’ll design a simple Spring Boot RESTful web application, exposing a few REST endpoints. Project Setup: Let’s start by downloading the project template via Spring […]

Be the First to comment. Read More
Spring

Spring Boot with H2 Database

Introduction: In this quick tutorial, we’ll bootstrap a simple Spring Boot application backed by an in-memory H2 database. We’ll use the Spring Data JPA to interact with our database. Project Setup: Firstly, let’s generate our project template using Spring Initializr: On clicking the ‘Generate the project’ link, our project files will get downloaded. Now, if […]

Be the First to comment. Read More
Spring

@SpringBootConfiguration Annotation in Spring Boot

Introduction: @SpringBootConfiguration annotation in Spring Boot is a class-level annotation which indicates that this class provides the application configuration. Generally, the class with the main() method is best-suited for this annotation. We usually use @SpringBootApplication annotation which automatically inherits the @SpringBootConfiguration annotation. Annotation Usage: When we mark a class with @SpringBootConfiguration, it means that the […]

Be the First to comment. Read More
Spring

Spring Boot CommandLineRunner and ApplicationRunner

Introduction: In this quick tutorial, we’ll explore the two very popular interfaces in Spring Boot: CommandLineRunner and ApplicationRunner. One common use case of these interfaces is to load some static data at application startup. Though, I have seen such usages mostly for test data setup only. Both of them are functional interfaces with a run() […]

Be the First to comment. Read More
Spring

Introduction to Spring Boot

Introduction: In this tutorial, we’ll take a look at Spring Boot and see how it’s different from the Spring framework. We’ll also discuss various features offered by Spring Boot. What is the Spring Boot? Spring is a powerful framework when it comes to developing enterprise-level applications. It provides us with features like dependency injection along […]

Be the First to comment. Read More
Other Tutorials

Identifying Code Smells In Java

Introduction: As a software developer, it’s our responsibility to not only write code that works but rather write code that’s maintainable. Martin Fowler in his book Refactoring: Improving the design of existing code defines a code smell as: A surface indication that usually corresponds to a deeper problem in the system Refactoring is a process […]

2 comments Read More
Other Tutorials

SOLID Design Principles

Introduction: Robert C. Martin defined five object-oriented design principles: Single-Responsibility Principle Open-Closed Principle Liskov’s Substitution Principle Interface Segregation Principle, and Dependency Inversion Principle These together are popularly known as the SOLID principles. When designing an object-oriented system, we should try to stick to these principles wherever possible. These principles help us design a system that’s […]

Be the First to comment. Read More
Other Tutorials

Strategy Design Pattern In Java

Introduction: The strategy design pattern is a behavioral pattern in which we have multiple algorithms/strategies for achieving a task and which algorithm/strategy to use is left for the client to choose. The various algorithm options are encapsulated in individual classes. In this tutorial, we’ll learn to implement the strategy design pattern in Java. UML Representation: […]

Be the First to comment. Read More
Other Tutorials

Mediator Design Pattern In Java

Introduction: In this tutorial, we’ll learn about a behavioral pattern that promotes loose coupling between several objects communicating with one another. The idea behind the Mediator design pattern is to have a central object that encapsulates how a set of objects interact. In the mediator pattern, we extract all the relationships between different classes in […]

Be the First to comment. Read More
Other Tutorials

Chain Of Responsibility Design Pattern In Java

Introduction: In this tutorial, we’ll learn how to implement the Chain Of Responsibility Pattern in Java. The Chain Of Responsibility design pattern involves having a chain of objects that are together responsible for handling a request. When a client sends a request, the first handler will try to process it. If it can process it, […]

Be the First to comment. Read More