- Hexagonal Architecture: A Lyrics App Example Using Java
This architecture principle was created by Alistair Cockburn in 2005. This is one of the many forms of Domain-Driven Design (DDD) Architecture. The goal was to find a way to solve or otherwise mitigate general caveats introduced by object-oriented programming.
This is also known as the Ports and Adapters Architecture. The hexagon concept isn’t related to a six-side architecture, nor does it have anything to do with the geometrical form. A hexagon has six sides indeed, but the idea is to illustrate the concept of many ports.
- Building a Simple RAG Application With Java and Quarkus
Introduction to RAG and Quarkus
Retrieval-augmented generation (RAG) is a technique that enhances AI-generated responses by retrieving relevant information from a knowledge source. In this tutorial, we’ll build a simple RAG-powered application using Java and Quarkus (a Kubernetes-native Java framework). Perfect for Java beginners!
Why Quarkus?
Quarkus provides multiple LangChain4j extensions to simplify AI application development, especially RAG implementation by providing an Easy RAG module for building end-to-end RAG pipelines. Easy RAG acts as a bridge, connecting the retrieval components (like your document source) with the LLM interaction within the LangChain4j framework.
- Apache Flink: Full Checkpoint vs Incremental Checkpoint
Apache Flink is a real-time data stream processing engine. Most of the stream processing applications are ‘stateful.’ This means the state is stored and used for further processing. In Apache Flink, the state is managed through a configured state backend. Flink supports two-state backends in production. One is the HashMapStateBackend
, and the other one is the EmbeddedRocksDBStateBackend
.
To prevent data loss and achieve fault tolerance, Flink can persist snapshots of the state to a durable storage. Flink can be configured to snapshot either the entire state into a durable location or the delta since the last snapshot. The former is called full checkpoint, and the latter is known as the incremental checkpoint.
- How Java Servlets Work: The Backbone of Java Web Apps
I assume that if you're reading this article, you already know what Servlets are. But if you don’t, let me introduce them.
In the Java world, a Servlet is a web component defined by the Jakarta Servlet Specification 6.1, which is part of Jakarta EE. Managed by a Servlet Container (I’ll dive into that soon), it handles incoming requests, processes them, and sends responses back to the client (see more in the Jakarta Servlet Specification 6.1).
- A Guide to Constructor Chaining in Java
Constructor chaining refers to the ability to call a constructor inside another constructor. You can use a constructor chain either within the same class or even with another one. For the latter, the constructor must be inherited from the superclass. In this Java programming tutorial, you will learn the three ways to implement constructor chaining.
Java Constructor Chaining in the Same Class
You can create multiple constructors in the same class, each with a different number of arguments that it accepts. To call one constructor within another (of the same class), use this()
.