Difference Between @JoinColumn and mappedBy 1. Introduction JPA Relationships can be either unidirectional or bidirectional. It simply means we can model them as an attribute on exactly one of the associated entities or both. Defining the direction of the relationship between entities has no impact on the database mapping. It… Continue Reading jpa-joincolumn-vs-mappedby

DDD Aggregates and @DomainEvents 1. Overview In this tutorial, we’ll explain how to use @DomainEvents annotation and AbstractAggregateRoot class to conveniently publish and handle domain events produced by aggregate – one of the key tactical design patterns in Domain-driven design. Aggregates accept business commands, which usually results in producing an… Continue Reading spring-data-ddd

First Round of Improvements to the Reddit Application 1. Overview The Reddit web application Case Study is moving along nicely – and the small web application is shaping up and slowly becoming usable. In this installment, we’re going to be making small improvements to the existing functionality – some externally… Continue Reading reddit-web-app-improvements-1

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

Implementing a Custom Spring AOP Annotation 1. Introduction In this article, we’ll implement a custom AOP annotation using the AOP support in Spring. First, we’ll give a high-level overview of AOP, explaining what it is and its advantages. Following this, we’ll implement our annotation step by step, gradually building up… Continue Reading spring-aop-annotation