Quantcast
Channel: Java Archives - Java Code Geeks
Browsing index pages (1310 articles)
↧

Resilience by Design vs. Resilience by Library: BEAM vs. Go and Java

In distributed systems engineering, few architectural divides are as deep—or as philosophically opposed—as how different runtimes handle failure. When an unexpected error occurs, what should happen?...

View Article


Exploring the Visitor Design Pattern with Java

Design patterns provide established approaches to recurring software design problems. Rather than being ready-made pieces of code, they describe how classes and objects can be organized to make an...

View Article


Spring Boot SSRF Mitigation with InetAddressFilter

Spring Boot applications often make HTTP requests to external services using clients such as RestClient, WebClient, or other HTTP client implementations. When the application controls the target URL,...

View Article

Building Reliable API Tests With Microcks

Modern applications usually depend on several APIs and microservices. During development and testing, however, those dependencies may not always be available. A downstream service might still be under...

View Article

Clojure’s Software Transactional Memory vs. Locks and CAS in Java

A third way to coordinate shared state: optimistic, language-level, and modeled directly on database transactions. Most Java developers reach for one of two tools when state needs protecting from...

View Article


Spring Boot REST Docs Example

Spring Boot REST APIs are commonly documented using tools such as Swagger/OpenAPI. Another useful option is Spring REST Docs, which generates API documentation from tests. In this article, we will...

View Article

Spring Boot CRUD Operations with Supabase

Spring Boot is widely used for building REST APIs and backend applications in Java. When an application needs persistent storage, Spring Boot can connect to traditional databases such as PostgreSQL,...

View Article

Java Scoped Values: A Practical Example

ScopedValue provides a way to share contextual data with methods without passing that data explicitly through every method parameter. A scoped value is bound only while a specific block of code is...

View Article


Goroutines vs. Virtual Threads: Two Routes to Lightweight Concurrency, a...

Go built its language around message passing from day one. Java spent thirty years on shared memory, then had to retrofit structure onto both. Go shipped goroutines complete in its first public release...

View Article


Java Compact Source Files: No Class, No Static Main

Java has traditionally required a class and a static main method even for the smallest programs. Java 25 changes this with compact source files and instance main methods, providing a simpler way to...

View Article

How to Fix Jackson LocalDate JSON Parse Errors

Jackson is one of the most commonly used libraries for converting JSON data into Java objects and vice versa. When working with Java’s modern date and time API, developers may sometimes encounter an...

View Article

DB-Scheduler: A Reliable Scheduler for Java

Scheduling background jobs is a common requirement in Java applications. Applications often need to send notifications, generate reports, clean up old data, synchronize information, or execute business...

View Article

Multiple Dispatch: Julia’s Different Answer to the Expression Problem

Sealed interfaces close the type list. Julia opens it, and the operation list, at once. A recent piece on this site walked through how sealed interfaces and exhaustive switch expressions give Java a...

View Article


Understanding Java AtomicInteger with an Example

When multiple threads access and modify the same variable, unexpected results can occur due to race conditions. A simple int variable is not thread-safe when it is updated concurrently. Java provides...

View Article

Understanding Java Virtual Threads with Example

Virtual Threads are one of the most important improvements to Java concurrency in recent years. They make it possible to run a very large number of concurrent tasks without creating the same number of...

View Article


Checked Exceptions: The Language Design Debate Java Never Resolved

Why Java stands almost alone among mainstream languages in forcing you to declare or catch certain exceptions, the criticism that shaped C# and Kotlin, and whether the reasoning behind it held up....

View Article

Java’s Sealed Classes Meet the Visitor Pattern

Replacing a classic GoF pattern with pattern matching: a before and after refactor of a Visitor hierarchy, collapsed into a sealed interface and an exhaustive switch expression. The Visitor pattern has...

View Article


How to Switch Between AI Models Automatically

AI applications do not always need the same language model for every request. A simple factual question may only require a small, fast model, while a request involving multiple constraints, reasoning...

View Article

Intelligent Document Processing with Apache Camel, Docling & LangChain4j

Enterprise applications often need to process large numbers of documents such as PDFs, invoices, manuals, reports, and policy documents. Extracting text from these documents is only the first step; the...

View Article

LLM Tool Call Reasoning with Embabel AI

Large language models become significantly more useful when they can interact with external tools instead of only generating text. A model can decide that it needs information from a database, an API,...

View Article
Browsing index pages (1310 articles)


Latest Images