Category: Tech

  • Mastering entity relation mapping in Java

    , ,

    Parent Perspective in Entity Mapping Have you ever asked: “Should the parent own the relation, with cascade all, and the child DTO not even mention the parent?” That’s often a good and clean approach, and here’s why. ✅ When the Parent Owns the Relation Pros: DTO Example (clean): No need for PersonDto inside PassportDto. ✅…

    Best way to map entity relations
  • Smarter Switch Statements

    , ,

    in Java 21 with Pattern Matching Java has come a long way since the days of switch (int) and switch (String). With Java 21, the switch statement becomes way more expressive thanks to pattern matching — allowing it to work seamlessly with types, records, sealed hierarchies, and more. In this post, we’ll explore what’s new…

    Pattern Matching Switch
  • Escape the If Jungle

    ,

    Modern Conditional Strategies in Java Classic Conditionals: Advanced or Alternative Structures: Now, let’s write a class that demonstrates a few of the more interesting and non-obvious ones: using enum with behavior, map of commands, and polymorphism. 📦 ConditionalStructuresShowcase.java This class shows three strong alternatives to conditionals: The java project can be found here.

    Conditional Control
  • 📨 Modern Messaging with Spring Boot and ActiveMQ

    , , ,

    Why Messaging Matters in Modern Applications In a distributed system, services often need to communicate asynchronously to ensure decoupling, scalability and resilience. Messaging systems enable this by allowing services to send and receive messages without needing to know about each other’s existence or availability in real time. This pattern is crucial in microservices, event-driven architectures…

    Apache ActiveMQ Artemis
  • Understanding One-to-One Relationships: Database vs Java (Hibernate)

    , , , ,

    When modeling One-to-One relationships, you can approach it in several ways depending on the ownership, lifecycle, and data modeling constraints. While Java and Hibernate offer flexibility in how this relationship is implemented at the code level, the root of it lies in database design. So let’s start there. One-to-One Relationship Strategies in Database Engineering In…

    Sql Diagram
  • Does Garbage Collector Choice Matters for Microservices?

    , ,

    When building and deploying microservices with Java — whether using Spring Boot or WildFly — one of the often-overlooked performance factors is the Garbage Collector (GC). Should you care about which GC your application uses? Or should you leave it to the infrastructure? Let’s break it down. Why Garbage Collector Choice Matters Garbage Collection is…

  • Mastering MapStruct

    ,

    @Mapping, @AfterMapping, and @MappingTarget in Action 🧩 Introduction In modern Java applications, especially with frameworks like Spring Boot, object mapping is a common task. Whether you’re transforming DTOs into entities or mapping between domain layers, doing this manually is tedious and error-prone. MapStruct is a compile-time code generator that simplifies this task—fast, type-safe, and easy…

    MapStruct
  • 🛠️ Step-by-Step: Install Caddy + WordPress on Ubuntu EC2

    , , , , ,

    ✅ 0. Prerequisites ✅ 1. Update System ✅ 2. Install PHP + Dependencies WordPress needs PHP and extensions: ✅ 3. Install Caddy (Official Script) Caddy will auto-start and be set as a systemd service. ✅ 4. Download and Setup WordPress 📁 Go to web root ⬇️ Download WordPress 🔐 Set permissions ✅ 5. Create a…

    wordpress
  • Use Amazon RDS (Managed MySQL Database)

    , , ,

    Free service AWS RDS (Relational Database Service) lets you run MySQL with automatic backups, security, and updates — no server setup needed. Pre-requisite: UC2 Server ✅ Steps to Create a MySQL Database on Amazon RDS 1. Go to RDS 2. Click “Create database” 3. Choose: 4. Settings 5. Instance size 6. Storage 7. Connectivity 8.…

    mysql
  • 🚀 How to Launch a New Ubuntu EC2 Server

    , , ,

    Free AWS Service Pre-requisite: AWS Account ✅ 1. Sign in to AWS Console Go to https://console.aws.amazon.com, and log in. ✅ 2. Open the EC2 Dashboard ✅ 3. Launch an Instance Click the “Launch instance” button. ✅ 4. Configure Instance Settings 🧾 Name and Tags 🖥️ Amazon Machine Image (AMI) 🧮 Instance Type 🔐 Key pair…

    ubuntu