Showing posts with label Spring. Show all posts
Showing posts with label Spring. Show all posts

Thursday, June 18, 2026

Maven Dependencies and Spring Boot Starters

Maven projects use dependencies to include external libraries. If your Maven project is a Spring Boot application, you can use Spring Boot dependency starters. A Spring Boot dependency starter is a collection of related libraries that enables a specific capability in your application, such as building web applications, accessing databases or securing endpoints.

The "Most Common Production REST API" Stack

If you inspect a typical business API in 2026, you'll often see something close to:

Usual Name Dependency Name
Spring Web spring-boot-starter-web
Testing spring-boot-starter-test
Spring Data JPA spring-boot-starter-data-jpa
Validation spring-boot-starter-validation
Spring Security spring-boot-starter-security
Actuator spring-boot-starter-actuator
PostgreSQL Driver org.postgresql:postgresql
Lombok org.projectlombok:lombok

That set alone probably covers 70–80% of typical Spring Boot backend applications built for internal tools, SaaS products, e-commerce systems, and microservices.

Thursday, June 11, 2026

Introduction to Spring Boot and Spring MVC

0. Introduction

Client–Server Architecture

The client–server architecture is a distributed application structure that divides workloads between service providers (servers) and service consumers (clients).

  • A service is an abstraction over computing resources.
  • A server hosts one or more server programs and exposes services to clients.
  • Clients request services and servers process those requests.
  • The most common communication stack is TCP/IP.
  • Examples of client–server applications include email systems, network printing systems, and the World Wide Web.

Saturday, June 6, 2026

Naming Conventions for Java Classes

Naming Conventions for Classes in Spring / Jakarta Applications

For a modern Java application, developers use widely recognized naming conventions that make codebases easier to navigate.

Suppose you want to give a name to objects by what their class is responsible for. The table is organizing so that it show in the first column the purpose of the object and in the other columns convention to follow to give a name to a class.

A small caveat first:

  • @Service, @Repository, and @Controller are Spring stereotypes.
  • Jakarta EE does not provide direct equivalents for all of them.
  • In Jakarta EE, developers often use @ApplicationScoped, @RequestScoped, @Singleton or EJB annotations such as @Stateless.

So the mapping is sometimes exact, sometimes only conceptual.

Tuesday, June 2, 2026

Spring Framework Dependency Injection Complete Example

0. Introduction: Why using interfaces?

A Java interface defines a set of behaviors as abstract methods. A class that implements that interface has to fulfill those behaviors. An interface defines what happens, an object defines how it happens.
Interfaces allow to decouple implementations. This reduces dependencies between implementations and allows to change implementations independently.

Sample Analogy: Booking a Room

Suppose you are designing an application that allows customers to book hotel rooms. When a customer makes a reservation, they are not concerned with the name of the hotel; they are primarily interested in the destination city and the check-in and check-out dates. The room booking application therefore provides an interface in which the customer requests an accommodation, rather than a specific hotel.

Thursday, May 14, 2026

Introduction To Spring Framework

1.0 What is an application framework?

An application framework is a set of reusable components and functionalities that simplifies software development by removing the need for developers to build applications from scratch.

When developing applications, you usually distinguish between boilerplate code and business code.

  • Boilerplate code handles common technical needs shared by many applications, such as error logging, transaction management, security, inter-system communication, and performance optimizations such as caching and data compression. Synonims of boilerplate code are: plumbing code, framework code and infrastructure code.
  • Business code implements the use cases and specific requirements of an application—what users expect the application to do. It is what makes one application different from another.

A framework lets developers focus on business code by providing reusable solutions for common technical needs, reducing the amount of infrastructure code that must be written and maintained.

2.0 Spring as a collection of frameworks

Spring is a collection of frameworks and libraries, not just a single framework; therefore we say that Spring is an ecosystem.

The most common modules in the Spring Framework ecosystem are:

  • Spring Core – the foundational module that provides essential capabilities, including:

    • Spring Context – manages the lifecycle and configuration of objects (beans)
    • Spring AOP (Aspect-Oriented Programming) – intercepts and modifies method execution
    • Spring Expression Language (SpEL) – provides an expression language used in configuration and annotations
  • Spring MVC (Model-View-Controller) – provides the components needed to build web applications and RESTful web services.

  • Spring Data Access – provides support for working with relational databases and data access technologies.

  • Spring Testing – provides tools for writing and running tests for Spring applications.