MyBatis Source Code Analysis: Mapper Proxy Mechanism
In earlier versions of MyBatis, developers could invoke database operations directly through the DefaultSqlSession's selectOne() method using the StatementID defined in Mapper XML files. This approach, while functional, presented significant maintainability challenges. The StatementID was specified as a hardcoded string constant, making refacto ...
Posted on Mon, 18 May 2026 18:03:21 +0000 by bidnshop
Understanding Factory Patterns, Dynamic Proxy, and XML in Java
Factory Patterns
Design patterns in software engineering represent proven solutions to common design problems. They enhance code reusability, readability, and maintainability by providing standardized approaches to structuring code.
Simple Factory Pattern
The simple factory pattern encapsulates object creation logic within a dedicated factory c ...
Posted on Sat, 16 May 2026 04:30:14 +0000 by robburne
Understanding Java Reflection: Dynamic Class Manipulation at Runtime
Many Java developers encounter reflection during their learning journey but often leave with only a vague understanding—or skip it entirely. This article demystifies what reflection is, how it works under the hood, and where it’s practically applied in real-world systems.
What Is Reflection?
According to Wikipedia, reflective programming refers ...
Posted on Fri, 15 May 2026 07:09:43 +0000 by lobo235
Implementing JDK Dynamic Proxies in Java
JDK dynamic proxies provide a mechanism to create proxy instances that implement specified interfaces at runtime. Here's a basic implementation:
import java.lang.reflect.*;
interface GreetingService {
void greet();
}
class GreetingServiceImpl implements GreetingService {
public void greet() {
System.out.println("Hello fr ...
Posted on Thu, 14 May 2026 08:33:27 +0000 by AtomicRax
Understanding Proxy Pattern in Java: Static, JDK Dynamic, and CGLIB Proxies
The proxy pattern provides a surrogate or placeholder for another object to control access to it. It is useful when a client object cannot or should not directly reference the target object, and the proxy acts as an intermediary. The core idea is to add additional behavior around the target's logic without modifying the target class itself. For ...
Posted on Mon, 11 May 2026 06:42:35 +0000 by mikeym