Intro to AspectJ 1. Introduction This article is a quick and practical introduction to AspectJ. First, we’ll show how to enable aspect-oriented programming, and then we’ll focus on the difference between compile-time, post-compile, and load-time weaving. Let’s start with a short introduction of aspect-oriented programming (AOP) and AspectJ’s basics. 2.… Continue Reading aspectj

Introduction to JavaPoet 1. Overview In this tutorial, we’ll explore the basic functionalities of the JavaPoet library. JavaPoet is developed by Square, which provides APIs to generate Java source code. It can generate primitive types, reference types and their variants (such as classes, interfaces, enumerated types, anonymous inner classes), fields, methods, parameters,… Continue Reading java-poet

The Dependency Inversion Principle in Java 1. Overview The Dependency Inversion Principle (DIP) forms part of the collection of object-oriented programming principles popularly known as SOLID. At the bare bones, the DIP is a simple – yet powerful – programming paradigm that we can use to implement well-structured, highly-decoupled, and… Continue Reading java-dependency-inversion-principle

A Guide to NanoHTTPD 1. Introduction NanoHTTPD is an open-source, lightweight, web server written in Java. In this tutorial, we’ll create a few REST APIs to explore its features. 2. Project Setup Let’s add the NanoHTTPD core dependency to our pom.xml: <dependency> <groupId>org.nanohttpd</groupId> <artifactId>nanohttpd</artifactId> <version>2.3.1</version> </dependency> To create a simple server, we… Continue Reading nanohttpd