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.

Monday, October 6, 2025

Character Sets and Character Encodings

1 What is it a Character Set?

Character Set - Informal definition

A character set is just a collection of symbols (letters, digits, punctuation, emojis, etc.) that a computer system knows about, together with the numbers (code points) assigned to them.

Character Set - Formal definition

A character set (more precisely, a coded character set) is a mapping between a finite set of abstract characters and a set of unique code points (integers).

It defines:

  • Character repertoire = the set of characters included.
  • Code space = the range of assignable numeric values.
  • Mapping function = assigns each character exactly one code point.

Formally:

f : Character ↔ CodePoint ∈ CodeSpace

Where the code point is the single integer value that uniquely identifies one abstract character

Tuesday, August 26, 2025

Docker Commands to Run Containers

In this section, we see the docker commands for creating, stopping, restarting and deleting containers

TOC:

1 Check for existing containers and images

The Docker commands to list existing containers and images in your local Docker environment

You can use the docker ps command to list any running container

$ docker ps
CONTAINER ID      IMAGE     COMMAND    CREATED     STATUS    PORTS     NAMES

You can use the docker images command to list local images

$ docker images  
REPOSITORY        TAG         IMAGE ID       CREATED     SIZE

You’re on a clean system with no pre-existing containers or images.

Monday, August 11, 2025

Introduction to Docker

1 Introduction to Containers
2 How to Containerization
3 Images
4 Containers
5 Registries
6 Docker Architecture
7 Containers for Microservices


1 Intro to Containers

The problem containers are meant to solve

Applications work in different environments, such as many development environments, testing environments and production environments.
An application relies on various dependencies to function correctly. These may include: programming libraries (e.g., Apache Commons for Java, React for JavaScript), frameworks (e.g., Spring and Struts for Java, Angular for JavaScript), runtime environments (e.g., Node.js, Java JDK), external APIs or services (e.g., Amazon S3, Google APIs), and operating system packages.
A common problem with application deployment is that an application may work in one environment but fail in another; this is often due to different environments having different versions of the application's dependencies.
Containers fix this problem, because they create an way to package applications along with their dependencies, so you deploy to production the same things you have developed.

Definitions:

Term Definition
Docker image A Docker image is the standard Docker package for distributing and running applications.
Docker container A Docker container is a running instance of a Docker image, or the Docker standard unit of execution.
Docker engine The Docker engine is the full Docker platform you install on your machine or server. It includes the Docker Daemon (dockerd), Docker CLI (docker), the REST API and other components to build and run containers, such as container runtime (runc), image builder, storage drivers and networking layer. The Docker engine runs natively on Linux, whereas on macOS/Windows it runs inside a Linux virtual machine.
Open Container Initiative The Open Container Initiative (OCI) is an organization created in 2015 by Docker and other industry leaders. It defines the official specifications for containers. These specifications allow container tools built by different vendors to work well together. Example container tools include Docker (by Docker Inc.), containerd (by CNCF), Podman (by Red Hat), CRI-O (also Red Hat) and Kubernetes (by CNCF).

Monday, May 26, 2025

Online Food Store Case Study

STEP 1 - System Requirements Analysis

1.1 Main Use Case: Making an Order

Here you do an examination the different stages involved in the process of how to do an online order

  1. Browsing and Adding to Cart: The customer explores the online store, finds items they like, and adds them to their virtual shopping cart. When the customer is finished adding items, they requests the cart; they may optionally edit the cart.

  2. Order Checkout: The customer clicks "proceed to order" and enters their personal information, shipping address, and payment details. The customer reviews their order summary, including the items, quantity, price, and shipping details. They then click a button like "Confirm Order" or "Place Order" or "Buy Now" to finalize the purchase. This action sends the order request to the online store.

  3. Confirmation Email: The customer receives a confirmation email with a summary of the order details and an order number. The store is acknowledging that the order has been received and is being processed.

  4. Payment Processing: The online store processes the customer's payment, ensuring the funds are securely transferred.

  5. Order Fulfillment: The online store prepares the order for shipment. This includes picking the items, packing them, and generating a shipping label.

  6. Shipping: The order is handed over to the shipping carrier, which delivers it to the customer's address.

  7. Delivery: The customer receives their order!

  8. Order Completion: The online store marks the order as complete in their system.

  9. Potential Return/Refund: The customer may have the option to return or request a refund for their order if they are not satisfied.

1.2 "Making an Order" System Sequence Diagrams
CustomerSystemAdminrequestMenu"Menu"loopaddItemToCart(item)requestCart"Cart"checkoutOrder(cart)"Order"setDeliveryAddresssetPaymentDetailsplaceOrder(order)"Order Confirmation Email"notifyAdmin(orderId, "new order")approveOrder(orderId)notifyCustomer("order is being prepared")updateOrderStatus(orderId, "ready for delivery")notifyCustomer("order is ready for delivery")notifyCustomer("order is delivered")updateInventory(item, quantity)

STEP 2 - OOA: Functional Requirements Analysis

When doing OO analysis, you create the Domain Model and draw classes/abstractions and interactions.

2.1 Online Food Store Key Abstractions
  • Customer: The person placing the order.
  • Menu: The list of available MenuItem.
  • MenuItem: The dishes items the Customer selects from the Menu. MenuItem details: price, description and dietary info
  • Cart: The virtual cart where the customer adds their items.
  • Restaurant: The establishment providing the food.
  • Order: The collection of items the customer wants.
  • OrderItem: a single item within an order, including quantity and any special instructions.
  • Address: The Customer delivery address and the Restaurant location
  • RestaurantAdmin: The person who accepts orders and manages the order states
  • Payment Details: a class that holds the details of the payment method used.
  • Payment System: The system used to process the payment.
  • Delivery Service: The service responsible for delivering the food.
  • Review/Rating: To allow customers to rate their experience.
2.2 Online Food Store Domain Model
Menumenu itemsMenuItemnamepriceCartorder itemsadd(menuItem)OrderItema menu itema quantityOrdercustomerorder itemsshipping addresspayment methodstatusCustomerfirst namelast nameemaildate of birthphone numberAddressPaymentcontains11..*contains11..*has11is used to createis placed by1*has11..*has11has11

STEP 3 - OOD: Sequence Diagram

3.1 The Sequence Diagram of the "Making an Order" Use Case
CustomerMainUIControllerRestaurantCartOrderMailingSystemPaymentServicePaymentGatewayDeliveryServiceAdminUIAdminrequestMenu()requestMenu()requestMenu()"Menu""Menu"loopaddItemToCart(item)addItemToCart(item)addItemToCart(item)add(item)requestCart()requestCart()requestCart()"Cart""Cart"checkoutOrder(cart)checkoutOrder(cart)checkoutOrder(cart)"Order""Order"setDeliveryAddress(address)setDeliveryAddress(address)setDeliveryAddress(address)setDeliveryAddress(address)setPaymentDetails(payment)setPaymentDetails(payment)setPaymentDetails(payment)setPaymentDetails(payment)placeOrder(order)placeOrder(order)placeOrder(order)sendConfirmationEmail(order)"Order Confirmation Email"updateOrderStatus(orderId, "pending")processPayment(payment)processPayment(payment)paymentResult(success/failure)paymentConfirmation(success/failure)updatePaymentStatus(success/failure)notifyAdmin("new order")approveOrder(orderId)approveOrder(orderId)notifyCustomer("order is being prepared")updateOrderStatus(orderId, "accepted")updateOrderStatus(Id, "ready for delivery")updateOrderStatus(orderId, "ready for delivery")updateOrderStatus(orderId, "ready for delivery")notifyCustomer("order is ready for delivery")requestDelivery(order)deliveryConfirmation(success/failure)updateOrderStatus(orderId, "delivered")notifyCustomer("order is delivered")updateInventory(item, quantity)

STEP 4 - OOD: Class Diagram

4.1 The Refined Domain Model Class Diagram

The class diagram of the design activity which represents the Refined Domain Model

Menuitems : List<MenuItem>MenuItemname : Stringprice : DoubleCartitems : List<OrderItem>add(:MenuItem)OrderItemitem : MenuItemquantity : IntegerCustomercustomerID : LongfirstName : StringlastName : Stringemail : Stringphone : StringshippingAddresses : Address[]billingAddress : AddresspaymentMethods : Payment[]OrderorderID : Longitems : List<OrderItem>customer : CustomershippingAddress : AddresspaymentMethod : PaymentpaymentStatus : StringtotalAmount : DoubleorderStatus : StringAddressPaymentcontains11..*11..*is used to create11is placed by10..*1111..*has11

Saturday, April 12, 2025

UML tools for eclipse IDE

Comparing eclipse IDE: UML Designer, Papyrus and Eclipse Modeling Tools

UML Designer, Eclipse Papyrus, and Eclipse Modeling Tools are all part of the Eclipse ecosystem, particularly focused on model-driven development (MDD). While they can overlap in functionality, they serve different purposes or cater to different user needs.


1. UML Designer (by Obeo)

  • Overview: A tool dedicated to UML modeling that provides a user-friendly interface.
  • Features: Lightweight, drag-and-drop interface, customizable viewpoints.
  • Best for: Beginner users who want standard UML diagrams.

2. Papyrus (by Eclipse Foundation)

  • Overview: A powerful modeling tool that supports multiple modeling languages.
  • Features: Support for UML 2.5, SysML and MARTE modeling languages.
  • Best for: Complex modeling, academic and industrial-grade modeling projects.

3. Eclipse Modeling Tools with UML Plugins

  • Overview: A general-purpose Eclipse package with optional UML plugins (like MDT UML2, EMF, GMF, etc.)
  • Features: Supports multiple modeling languages and frameworks: EMF, GMF, Ecore tools, etc.
  • Best for: Developers creating custom modeling tools or DSLs

Comparison Table

Tool Purpose UML Diagram Support Complexity Target Audience
Eclipse UML Designer UML modeling Good UML support Medium Developers needing custom diagram views
Eclipse Papyrus Multi-language (SysML, UML, MARTE...) modeling environment Full UML 2.x support High System engineers, advanced UML users
Eclipse Modeling Tools A package that includes EMF, GMF, and more Varies by plugin High Developers building modeling tools

Note: The UML Designer 9.0.0 standalone IDE is based on eclipse Oxygen (2017) and includes a JRE 8. UML Designer 9.0.0 can only run on older Ubuntu (e.g. 18.04 or 20.04); newer Ubuntu versions will have compatibilty issues with SWT included with UML Designer. The UML Designer 9.0.0 plugin will not work with current eclipse versions running on JDK 17 and higher.
Solution: Try running UML Designer in a Docker container with an older Ubuntu (e.g., 18.04 or 20.04) and the library versions match what UML Designer expects.
You can use an image like this:

FROM ubuntu:20.04
RUN apt update && apt install -y openjdk-8-jdk libgtk-3-0 libcanberra-gtk3-module libfreetype6
COPY UMLDesigner/ /opt/UMLDesigner/
WORKDIR /opt/UMLDesigner/
CMD ["./UMLDesigner"]

Or even easier: use a base image with Eclipse Oxygen preinstalled.

Friday, October 22, 2021

Eclipse IDE tips

1 Importing a Git project

To import a Git project into an eclipse project, open the command line terminal and move to eclipse workspace:

user@host:~$ cd eclipse-workspace/

clone the Git project into a newly created project folder:

user@host:~/eclipse-workspace$ git clone https://github.com/davidflanagan/jstdg7 Flanagan-JavaScript-Book-7Ed

The Flanagan-JavaScript-Book-7Ed folder is going to be the base folder of the eclipse project.
Run eclipse IDE and open the "eclipse-worskspace" folder. To import the project, select the option File -> Import -> General -> Project from Folder or Archive and click on Next button.

This opens a the "Import Projects from File System or Archive" window, click on "Directory" button. This opens a file chooser, navigate to the newly created folder and click on Open to import the project into eclipse IDE.

2 Importing a Maven project

Download a maven project, for example by cloning a git repo or by using the maven archetype plugin
In my case I am going to clone the maven project from git

Open the command line terminal and move to eclipse workspace:

user@host:~$ cd eclipse-workspace/

clone the Maven project into a newly created project folder:

git clone https://github.com/heroku/java-getting-started heroku-getting-started

You have cloned the Git project into the heroku-getting-started folder. That folder is going to be the base folder of the eclipse project.
Run eclipse IDE and open the "eclipse-worskspace" folder. To import the project, select the option File -> Import -> Maven -> Existing Maven Projects and click on Next button.

This opens a window that allows you to chose the project root directory, click on the Browse button.
This open a file selector, select the folder of the Maven project to be imported. This is what you get:

Select the pom of the project you want to import and click finish. In case you are importing a multi module maven project select the parent pom and all the poms of subproject you want to import.

3 Make eclipse IDE build faster

3.1 Turn Off Validations

As soon as you open a project, eclipse starts to build the project. Validation is part of projects building. If your workspace has many projects open, validation may take too long, threfore you may want to turn off validation to make building faster.

You can disable validators either for your project or for your workspace. To disable validators for your workspace, select Window -> Preferences -> Validation. This opens the Validation window. You can tick the second check box in the upper list "Suspend all Validators" or you can choose to disable individual validator by clearing the box next each validator.

3.2 Uncheck Auto Build

The menu item Project -> Build Automatically is checked by default. That means eclipse build all projects (both closed and opened projects) in your workspace whenever you open the workspace or run a clean command. So, if you your workspace holds many projects, it is convenient to uncheck the Build Automatically item.

Doing so, it will disable automatic building for the projects. To build the project you are currently working on, select the Project -> Clean item, uncheck Clean all projects and select Build only the selected project.