Tagged articles
1744 articles
Page 15 of 18
Su San Talks Tech
Su San Talks Tech
Jan 3, 2021 · Backend Development

Eliminate Long if‑else Chains in Java: Design Patterns & Spring Solutions

This article examines the drawbacks of lengthy if‑else statements in Java payment services, explains how they violate the Open/Closed and Single Responsibility principles, and presents multiple refactoring techniques—including custom annotations, dynamic bean naming, template methods, strategy‑factory, and chain‑of‑responsibility patterns—to produce cleaner, more maintainable backend code.

if-elsespringstrategy
0 likes · 17 min read
Eliminate Long if‑else Chains in Java: Design Patterns & Spring Solutions
Programmer DD
Programmer DD
Jan 3, 2021 · Backend Development

Why Spring Ecosystem Dominates Java: Surprising Top200 Rankings Unveiled

An in‑depth look at the latest Java Top‑200 project rankings reveals Spring’s ecosystem as the de‑facto standard, while contrasting tools such as Gradle versus Maven, Kafka versus Pulsar, Spring Security versus Shiro, and many others, highlighting performance, adoption and community strength across the backend landscape.

Backendframeworksjava
0 likes · 4 min read
Why Spring Ecosystem Dominates Java: Surprising Top200 Rankings Unveiled
Java Backend Technology
Java Backend Technology
Dec 27, 2020 · Backend Development

Do You Really Need Interfaces for Service and DAO Layers in Spring?

This article examines whether Service and DAO layers in Spring projects truly require interfaces, debunks common justifications, explores alternative project structures for single and multiple implementations, and offers practical guidelines on when to use or omit interfaces.

Interface DesignService Layerdao
0 likes · 8 min read
Do You Really Need Interfaces for Service and DAO Layers in Spring?
21CTO
21CTO
Dec 24, 2020 · Backend Development

Why Java Isn’t Dead: A Developer’s Take on Spring, Microservices, and KISS

The author reflects on returning to Java after three years, arguing that despite the rise of containers and micro‑services, Java’s performance, threading model, and mature ecosystem keep it relevant, while criticizing Spring’s complexity and advocating a simple, KISS‑driven approach.

ContainersKISSMicroservices
0 likes · 8 min read
Why Java Isn’t Dead: A Developer’s Take on Spring, Microservices, and KISS
Senior Brother's Insights
Senior Brother's Insights
Dec 24, 2020 · Backend Development

Spring Filter vs Interceptor: When to Use Each in Java Web Apps

This guide explains the concepts, implementation steps, configuration examples, and key differences between Servlet Filters and Spring MVC Interceptors, helping developers choose the right tool for request preprocessing, logging, and access control in Java web applications.

Interceptorbackend-developmentfilter
0 likes · 12 min read
Spring Filter vs Interceptor: When to Use Each in Java Web Apps
Architecture Digest
Architecture Digest
Dec 21, 2020 · Backend Development

Do You Need an Interface for the Service Layer? A Critical Examination

This article examines whether a Service layer in a Spring‑based backend project truly requires an interface, debunks common justifications, proposes practical development workflows, and outlines the advantages and drawbacks of using or omitting interfaces in various architectural scenarios.

Backend ArchitectureInterfaceService Layer
0 likes · 8 min read
Do You Need an Interface for the Service Layer? A Critical Examination
Selected Java Interview Questions
Selected Java Interview Questions
Dec 11, 2020 · Databases

Implementing MyBatis Streaming Queries in Spring: Concepts, API, and Three Practical Solutions

This article explains the concept of streaming queries, introduces MyBatis's Cursor interface, demonstrates how to use it in Spring MVC controllers, and provides three concrete solutions—using SqlSessionFactory, TransactionTemplate, and @Transactional—to keep the database connection open and avoid cursor‑closed errors.

CursorMyBatisStreaming Query
0 likes · 7 min read
Implementing MyBatis Streaming Queries in Spring: Concepts, API, and Three Practical Solutions
Top Architect
Top Architect
Dec 8, 2020 · Backend Development

Understanding Thread Safety of Spring Beans: Singleton vs Prototype Scope

This article explains why Spring beans are not inherently thread‑safe, compares the singleton and prototype scopes, shows how stateless beans can be safe, demonstrates the impact of static fields and injected beans, and provides practical code examples and recommendations for achieving thread safety in Spring applications.

Singletonbeanjava
0 likes · 11 min read
Understanding Thread Safety of Spring Beans: Singleton vs Prototype Scope
Code Ape Tech Column
Code Ape Tech Column
Dec 7, 2020 · Backend Development

Unlock Spring’s Power: 9 Design Patterns Every Java Developer Should Master

This article explores nine core design patterns implemented in Spring—simple factory, factory method, singleton, adapter, decorator, proxy, observer, strategy, and template method—detailing their implementation mechanisms, underlying principles, code examples, and practical significance for building loosely coupled, extensible Java applications.

Design PatternsTemplate Methodaop
0 likes · 16 min read
Unlock Spring’s Power: 9 Design Patterns Every Java Developer Should Master
Programmer DD
Programmer DD
Dec 5, 2020 · Backend Development

Mastering Spring Retry: Deep Dive into Retry and Back‑off Strategies

This article explains Spring Retry's architecture, how @EnableRetry, @Retryable, @Backoff and @Recover work together, details the available retry and back‑off policies, and walks through the core implementation using RetryTemplate and interceptors to provide flexible, AOP‑based retry handling in Java backend applications.

BackoffRetryRetryPolicy
0 likes · 20 min read
Mastering Spring Retry: Deep Dive into Retry and Back‑off Strategies
Top Architect
Top Architect
Nov 30, 2020 · Backend Development

Understanding AOP in Spring: Concepts, Annotations, and Practical Examples

This article explains the fundamentals of Aspect‑Oriented Programming (AOP) in Spring, describes its core concepts and terminology, and provides step‑by‑step code examples for creating pointcuts, advices, and custom annotations, while also detailing the use of common AOP annotations such as @Pointcut, @Around, @Before, @After, @AfterReturning and @AfterThrowing.

Aspect Oriented Programmingaopjava
0 likes · 19 min read
Understanding AOP in Spring: Concepts, Annotations, and Practical Examples
Su San Talks Tech
Su San Talks Tech
Nov 30, 2020 · Backend Development

How to Tame Large Transactions in Spring: 6 Proven Strategies

This article shares practical techniques for handling large transactions in Spring-based backend systems, covering why @Transactional can cause issues, how to use programmatic transactions, move queries outside transactions, avoid remote calls, limit data volume, execute non‑transactional operations, and leverage asynchronous processing.

Declarative TransactionLarge TransactionsProgrammatic Transaction
0 likes · 10 min read
How to Tame Large Transactions in Spring: 6 Proven Strategies
Architecture Digest
Architecture Digest
Nov 28, 2020 · Databases

How to Perform Streaming Queries with MyBatis Cursor and Keep the Database Connection Open

This article explains the concept of streaming queries in MyBatis, introduces the Cursor interface, demonstrates common pitfalls with connection closure, and provides three practical solutions—using SqlSessionFactory, TransactionTemplate, or @Transactional—to safely retrieve large result sets without exhausting memory.

CursorMyBatisStreaming Query
0 likes · 7 min read
How to Perform Streaming Queries with MyBatis Cursor and Keep the Database Connection Open
Top Architect
Top Architect
Nov 25, 2020 · Databases

Understanding MyBatis Transaction Mechanisms and JDBC Transaction Behavior

This article explains the real JDBC transaction methods, clarifies common misconceptions about transaction states in MyBatis, details the MyBatis Transaction and TransactionFactory interfaces, and explores special scenarios such as auto‑commit false, missing commit or close, with concrete code examples.

JDBCMyBatisdatabase
0 likes · 10 min read
Understanding MyBatis Transaction Mechanisms and JDBC Transaction Behavior
Top Architect
Top Architect
Nov 22, 2020 · Backend Development

Spring vs Spring Boot: Core Differences, Configuration, and Deployment Guide

This article compares Spring and Spring Boot, explaining their fundamental concepts, Maven dependencies, MVC and security configurations, template engine setup, startup mechanisms, and packaging options, while providing practical code examples to help Java developers choose and migrate between the two frameworks.

ConfigurationSpringBootjava
0 likes · 12 min read
Spring vs Spring Boot: Core Differences, Configuration, and Deployment Guide
JavaEdge
JavaEdge
Nov 20, 2020 · Backend Development

Why Java Annotations Don't Inherit to Subclass Methods and How to Work Around It

This article explains the limits of annotation inheritance in Java, demonstrates why subclass methods cannot automatically inherit parent annotations, and shows how to use @Inherited, Spring's AnnotatedElementUtils, and find/get semantics to retrieve inherited annotations effectively.

@InheritedAnnotatedElementUtilsInheritance
0 likes · 6 min read
Why Java Annotations Don't Inherit to Subclass Methods and How to Work Around It
Java Backend Technology
Java Backend Technology
Nov 19, 2020 · Backend Development

Why Long Database Transactions Crash Services and How to Prevent Them

The article explains how long‑running database transactions can exhaust connection pools, block threads, and cause widespread service failures, then offers practical strategies—including keeping transactions short, removing RPC calls, enhancing monitoring, and reviewing code—to detect and prevent these high‑risk issues.

Backend PerformanceDatabase Connection Poollong transactions
0 likes · 7 min read
Why Long Database Transactions Crash Services and How to Prevent Them
IT Xianyu
IT Xianyu
Nov 18, 2020 · Backend Development

Understanding Spring Framework: Core Concepts, Advantages, and Bean Management

This article provides a comprehensive overview of the Spring framework, explaining its IoC and AOP core, architectural layers, key advantages such as decoupling and declarative transactions, bean scopes, lifecycle settings, and practical object‑creation methods for Java backend development.

BackendBean ScopeIoC
0 likes · 7 min read
Understanding Spring Framework: Core Concepts, Advantages, and Bean Management
Programmer DD
Programmer DD
Nov 11, 2020 · Backend Development

BeanFactory vs ApplicationContext: When to Choose Each in Spring

Spring provides two IoC containers—BeanFactory and ApplicationContext—each with distinct loading strategies, features, and registration behaviors; this article demonstrates their differences through practical code examples, highlighting lazy versus eager loading, automatic post‑processor registration, and why ApplicationContext is generally preferred for enterprise applications.

BeanFactoryIoCapplicationcontext
0 likes · 9 min read
BeanFactory vs ApplicationContext: When to Choose Each in Spring
Xianyu Technology
Xianyu Technology
Nov 5, 2020 · Backend Development

Accelerating Build, Deployment, and Startup for Java Backend Applications

By profiling the idle‑local Java backend, the author cut build, deployment, and startup times by over 30 seconds per cycle through asynchronous Spring bean initialization, selective dependency pruning, layered Docker image construction, and streamlined shutdown, demonstrating a comprehensive, reusable optimization strategy for faster releases.

Build OptimizationDockerStartup Acceleration
0 likes · 13 min read
Accelerating Build, Deployment, and Startup for Java Backend Applications
Top Architect
Top Architect
Nov 3, 2020 · Backend Development

Do Service and DAO Layers Need Interfaces? When to Use Them in Spring Projects

This article examines whether every Service and DAO class in a Spring‑based backend should implement an interface, evaluates the common arguments for using interfaces, explains why they often do not hold up, and proposes practical structuring and development approaches for projects that may or may not need multiple implementations.

InterfaceService Layerdao
0 likes · 9 min read
Do Service and DAO Layers Need Interfaces? When to Use Them in Spring Projects
Java Backend Technology
Java Backend Technology
Oct 31, 2020 · Backend Development

Mastering Java Exceptions and @Transactional: When Do Transactions Roll Back?

This article explains Java exception categories, distinguishing checked from unchecked exceptions, and shows how Spring's @Transactional annotation controls transaction rollbacks, including configurations for rolling back on checked exceptions, preventing rollback on unchecked ones, and best practices for applying @Transactional in backend services.

Exception Handlingjavaspring
0 likes · 5 min read
Mastering Java Exceptions and @Transactional: When Do Transactions Roll Back?
Laravel Tech Community
Laravel Tech Community
Oct 28, 2020 · Backend Development

Grails 4.0.5 Release: New Features, Updates, and Improvements

Grails 4.0.5 has been released, introducing new features such as enhanced REST API configuration, plugin.groovy loading, performance optimizations, and updates to Micronaut, Spring, SpringBoot, and GORM Datastore, along with improved documentation and resolved issues.

GrailsGroovyHibernate
0 likes · 2 min read
Grails 4.0.5 Release: New Features, Updates, and Improvements
Architect's Tech Stack
Architect's Tech Stack
Oct 27, 2020 · Backend Development

Differences Between Spring and Spring Boot: Configuration, MVC, Security, and Deployment

This article explains the fundamental differences between Spring and Spring Boot, covering their core concepts, configuration methods, MVC setup, template engine integration, security configuration, bootstrapping mechanisms, and packaging/deployment options, with detailed code examples for each aspect.

Spring BootWeb Developmentmaven
0 likes · 10 min read
Differences Between Spring and Spring Boot: Configuration, MVC, Security, and Deployment
Top Architect
Top Architect
Oct 24, 2020 · Backend Development

Designing a Unified API Response Format for Java Backend Services

This article explains how to create a consistent JSON response structure for Java backend APIs, covering status‑code conventions, a Result wrapper class, static helper methods, a custom @ResponseResult annotation, response‑body advice, and tips for simplifying controller code and handling exceptions.

annotationsapi-designjava
0 likes · 7 min read
Designing a Unified API Response Format for Java Backend Services
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Oct 20, 2020 · Backend Development

Programmatic vs Declarative Transactions in Spring: Advantages, Pitfalls, and Recommendations

This article compares Spring's programmatic and declarative transaction management, explains how each works with code examples, outlines the benefits and limitations of declarative transactions—including granularity and failure scenarios—and argues why developers should consider programmatic transactions for clearer control and fewer hidden bugs.

Declarative TransactionProgrammatic Transactionaop
0 likes · 8 min read
Programmatic vs Declarative Transactions in Spring: Advantages, Pitfalls, and Recommendations
Top Architect
Top Architect
Oct 18, 2020 · Backend Development

Understanding Spring @Enable Annotation Logic and the Role of ConfigurationClassPostProcessor

This article explains how Spring's @Enable annotations are driven by @Import, walks through the entry points in spring.handlers, details the processing flow of ConfigurationClassPostProcessor, distinguishes full and lightweight configuration modes, and describes the CGLIB enhancement that ensures proper @Bean method semantics.

BeanDefinitionConfigurationClassPostProcessorannotations
0 likes · 10 min read
Understanding Spring @Enable Annotation Logic and the Role of ConfigurationClassPostProcessor
Top Architect
Top Architect
Oct 12, 2020 · Backend Development

Comprehensive Guide to Common Spring Framework Annotations

This article provides a comprehensive overview of the most commonly used Spring Framework annotations, including core, stereotype, Spring Boot, MVC/REST, data access, scheduling, and testing annotations, with explanations and code examples illustrating their usage in Java backend development.

DependencyInjectionSpringBootannotations
0 likes · 12 min read
Comprehensive Guide to Common Spring Framework Annotations
JavaEdge
JavaEdge
Oct 10, 2020 · Fundamentals

Why High‑Level Modules Should Depend on Abstractions: Mastering Dependency Inversion

This article explains the Dependency Inversion Principle, shows why traditional layered architectures suffer from maintenance and reuse problems, provides concrete Java and web examples, and demonstrates how refactoring to abstract interfaces resolves these issues for more flexible, decoupled software design.

Dependency InversionSoftware Architectureabstraction
0 likes · 9 min read
Why High‑Level Modules Should Depend on Abstractions: Mastering Dependency Inversion
IT Xianyu
IT Xianyu
Oct 8, 2020 · Backend Development

Overview of Spring, Spring MVC, Spring Boot, and Spring Cloud

This article introduces Spring as a lightweight IoC and AOP container, explains Spring MVC as its web framework, describes Spring Boot's convention‑over‑configuration approach to simplify setup, and outlines how Spring Cloud builds on Spring Boot to provide micro‑service governance.

BackendSpringCloudSpringMVC
0 likes · 3 min read
Overview of Spring, Spring MVC, Spring Boot, and Spring Cloud
Java Captain
Java Captain
Oct 6, 2020 · Backend Development

Integrating Alipay Payment into an SSM (Spring + Spring MVC + MyBatis) Framework

This tutorial walks through the complete process of configuring a sandbox Alipay environment, setting up keys and URLs, defining the database schema, implementing DAO and service layers, and integrating Alipay payment flow into a Java SSM project with detailed code examples and screenshots.

AlipayMyBatisPayment Integration
0 likes · 11 min read
Integrating Alipay Payment into an SSM (Spring + Spring MVC + MyBatis) Framework
Top Architect
Top Architect
Oct 5, 2020 · Backend Development

Deep Dive into Spring Framework Container Startup: Constructor, BeanFactory, Reader, and Scanner Initialization

This article walks through the Spring Framework container startup process, explaining how the AnnotationConfigApplicationContext constructor prepares the environment, registers readers and scanners, initializes the BeanFactory, sets up condition evaluators and post‑processors, and outlines the default filters used for component scanning.

AnnotationConfigApplicationContextBeanFactorydependency-injection
0 likes · 15 min read
Deep Dive into Spring Framework Container Startup: Constructor, BeanFactory, Reader, and Scanner Initialization
Top Architect
Top Architect
Sep 30, 2020 · Backend Development

How to Create and Use Custom Annotations for Field, Method, and Class Validation in Java

This article explains how to define custom Java annotations for field, method, and class validation, demonstrates the required @Target and @Retention settings, shows how to implement a ConstraintValidator, and provides practical Spring examples for permission checks and caching using interceptors and aspects.

Aspect Oriented ProgrammingCustom Annotationjava
0 likes · 9 min read
How to Create and Use Custom Annotations for Field, Method, and Class Validation in Java
ITPUB
ITPUB
Sep 29, 2020 · Backend Development

Why Spring WebFlux Matters: Moving Beyond Servlet‑Based MVC

This article explains how Spring WebFlux, built on the Reactor project, provides a reactive, non‑blocking alternative to traditional Servlet‑based Spring MVC, detailing its advantages, limitations, and the considerations developers must evaluate before adopting it.

WebFluxbackend-developmentjava
0 likes · 9 min read
Why Spring WebFlux Matters: Moving Beyond Servlet‑Based MVC
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Sep 26, 2020 · Fundamentals

Understanding Factory Patterns: Simple Factory, Factory Method, and Abstract Factory with Spring Dependency Injection

This article explains the three common factory design patterns—simple factory, factory method, and abstract factory—illustrates their Java implementations with product and factory classes, demonstrates client usage, and shows how Spring's dependency injection can replace manual factory instantiation, providing a comprehensive guide for developers.

Abstract FactoryDesign PatternsFactory Pattern
0 likes · 7 min read
Understanding Factory Patterns: Simple Factory, Factory Method, and Abstract Factory with Spring Dependency Injection
Selected Java Interview Questions
Selected Java Interview Questions
Sep 21, 2020 · Backend Development

Understanding Spring Framework Core Interfaces and Bean Lifecycle from Source Code

This article explains the core interfaces of the Spring Framework, such as BeanDefinition, BeanFactory, ApplicationContext, and BeanPostProcessor, and walks through the bean creation process—including refresh, preInstantiateSingletons, getBean, and the three‑level singleton caches—providing detailed code examples and insights into how Spring resolves circular dependencies.

Frameworkbean-lifecycledependency-injection
0 likes · 28 min read
Understanding Spring Framework Core Interfaces and Bean Lifecycle from Source Code
JavaEdge
JavaEdge
Sep 19, 2020 · Backend Development

Mastering Spring Bean Definitions: Naming, Aliases, and Instantiation

Learn how Spring stores bean metadata, the structure of BeanDefinition, naming conventions, alias configuration, and various bean instantiation methods—including constructors, static and instance factory methods—while also discovering how to determine a bean's runtime type using BeanFactory.getType.

BackendBeanDefinitiondependency-injection
0 likes · 11 min read
Mastering Spring Bean Definitions: Naming, Aliases, and Instantiation
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Sep 14, 2020 · Backend Development

Implementing Spring Event‑Driven Architecture with Asynchronous Listeners

This article explains how to use Spring's event‑driven mechanism to decouple business operations such as saving a product and sending notifications, showing step‑by‑step code for custom events, publishing, asynchronous listeners, and custom thread‑pool configuration to improve resilience and maintainability.

BackendEvent-drivenMessaging
0 likes · 5 min read
Implementing Spring Event‑Driven Architecture with Asynchronous Listeners
Top Architect
Top Architect
Sep 12, 2020 · Backend Development

Key Considerations for Building a Generic TCC Distributed Transaction Framework

This article explains the essential design principles of a TCC (Try‑Confirm‑Cancel) distributed transaction framework, covering the necessity of RM local transactions, integration with Spring's TransactionManager, fault‑recovery mechanisms, idempotency guarantees, and handling of parallel Try/Confirm/Cancel operations.

Distributed TransactionsTransactionManagerfault-recovery
0 likes · 22 min read
Key Considerations for Building a Generic TCC Distributed Transaction Framework
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Sep 9, 2020 · Fundamentals

Understanding the Template Method Design Pattern with Java Examples

This article explains the Template Method design pattern, illustrating its structure with Java code examples—including an abstract Drinks class, concrete Tea and Coffee subclasses, hook methods, and real‑world usages in JDK sorting and Spring's application context—while highlighting advantages, drawbacks, and typical scenarios.

Hook MethodTemplate Methoddesign pattern
0 likes · 12 min read
Understanding the Template Method Design Pattern with Java Examples
Top Architect
Top Architect
Sep 6, 2020 · Backend Development

Understanding Spring @Transactional: Common Pitfalls and Proper Usage

This article explains how Spring's @Transactional annotation works, common pitfalls such as using it on private methods, and the correct ways to configure propagation, isolation, and bean injection to ensure proper transaction rollback and non‑rollback behavior.

annotationaopjava
0 likes · 8 min read
Understanding Spring @Transactional: Common Pitfalls and Proper Usage
The Dominant Programmer
The Dominant Programmer
Sep 4, 2020 · Backend Development

Using SpringBoot’s MessageSource.getMessage for Easy i18n Localization

SpringBoot supports internationalization out of the box; by creating a messages.properties file under resources, configuring the basename in application.yml, and using a MessageUtils wrapper that retrieves MessageSource via SpringUtils, developers can fetch localized messages with a single method call.

i18nlocalizationmessagesource
0 likes · 6 min read
Using SpringBoot’s MessageSource.getMessage for Easy i18n Localization
Top Architect
Top Architect
Aug 30, 2020 · Backend Development

Using Spring Cache with Redis for Efficient Data Caching in Java Applications

This article explains how to accelerate service response by integrating Redis as a key‑value cache with Spring Cache, covering the three‑step implementation, required Maven dependencies, XML configuration, property settings, a custom Cache implementation class, and common Spring Cache annotations.

CacheSpringCacheaop
0 likes · 12 min read
Using Spring Cache with Redis for Efficient Data Caching in Java Applications
Programmer DD
Programmer DD
Aug 28, 2020 · Backend Development

Master Spring Validation: Best Practices and Advanced Techniques

This article provides a comprehensive guide to Spring Validation, covering basic usage, dependency setup, requestBody and requestParam validation, group and nested validation, collection checks, custom constraints, programmatic validation, fail‑fast configuration, and the underlying implementation mechanisms within Spring MVC and Hibernate Validator.

BackendHibernatespring
0 likes · 17 min read
Master Spring Validation: Best Practices and Advanced Techniques
Su San Talks Tech
Su San Talks Tech
Aug 27, 2020 · Backend Development

Unveiling Spring Transaction Mechanics: From Annotations to Core Interceptors

This article dives deep into Spring's transaction infrastructure, explaining how @EnableTransactionManagement activates transaction support, detailing the roles of key configuration classes, core interceptors, transaction attribute resolution, propagation behaviors, and the commit‑and‑rollback processes that power reliable data operations in Spring and Spring Boot applications.

BackendSpringBootaop
0 likes · 32 min read
Unveiling Spring Transaction Mechanics: From Annotations to Core Interceptors
Top Architect
Top Architect
Aug 22, 2020 · Backend Development

Comprehensive Guide to Spring Validation: Usage, Advanced Features, and Implementation Principles

This article provides a thorough tutorial on Spring Validation, covering basic usage with requestBody and requestParam, dependency setup, group, nested, collection and custom validations, programmatic validation, fail‑fast mode, differences between @Valid and @Validated, as well as the underlying implementation mechanisms in Spring MVC and method‑level AOP validation.

APIHibernate ValidatorSpring Boot
0 likes · 17 min read
Comprehensive Guide to Spring Validation: Usage, Advanced Features, and Implementation Principles
Java Captain
Java Captain
Aug 21, 2020 · Backend Development

Creating Custom Annotations for Validation, Permission, and Caching in Java Backend Development

This article explains how to design and implement custom Java annotations for field validation, permission checks, and caching, covering annotation definitions, target and retention policies, validator classes, interceptor and aspect implementations, and practical usage examples within Spring MVC.

Aspect Oriented ProgrammingCustom Annotationsbackend-development
0 likes · 9 min read
Creating Custom Annotations for Validation, Permission, and Caching in Java Backend Development
Programmer DD
Programmer DD
Aug 19, 2020 · Backend Development

Unlocking Spring’s @Async: Deep Dive into Mechanics, Pitfalls, and Solutions

This article explores Spring’s @Async annotation in depth, detailing its basic usage, underlying proxy creation, pointcut logic, and asynchronous execution, while highlighting common issues such as circular dependencies and inefficient default thread pools, and providing practical solutions like lazy injection and custom executors.

AsyncDependencyInjectionThreadPool
0 likes · 15 min read
Unlocking Spring’s @Async: Deep Dive into Mechanics, Pitfalls, and Solutions
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Aug 18, 2020 · Backend Development

Implementing Scheduled Tasks in Java: Timer, ScheduledExecutorService, Spring Task, and Distributed Approaches

This article explains several ways to implement scheduled tasks in Java, covering the simple Timer class, the more robust ScheduledExecutorService, Spring's @Scheduled annotation, and distributed solutions using Redis ZSet and key‑space notifications, with code examples and practical considerations.

Distributed SchedulingScheduled TasksScheduledExecutorService
0 likes · 16 min read
Implementing Scheduled Tasks in Java: Timer, ScheduledExecutorService, Spring Task, and Distributed Approaches
Java Backend Technology
Java Backend Technology
Aug 18, 2020 · Backend Development

Why Spring Controllers Are Not Thread‑Safe and How to Fix Them

Spring MVC controllers are singleton by default, which can cause thread‑unsafe behavior when using non‑static member variables; this article demonstrates the issue with example endpoints, shows how prototype scope resolves it, and outlines best practices such as avoiding stateful fields or using ThreadLocal.

Bean ScopeControllerSingleton
0 likes · 5 min read
Why Spring Controllers Are Not Thread‑Safe and How to Fix Them
Programmer DD
Programmer DD
Aug 11, 2020 · Backend Development

Mastering Spring’s Circular Dependency: How the Three-Level Cache Solves Bean Loops

This article explains Spring's circular dependency problem, the conditions under which it can be resolved, and how Spring's three‑level cache—combined with AOP proxy handling—enables beans to reference each other without causing creation failures, providing a comprehensive answer for interview scenarios.

Three-level Cacheaopbean-lifecycle
0 likes · 18 min read
Mastering Spring’s Circular Dependency: How the Three-Level Cache Solves Bean Loops
Top Architect
Top Architect
Aug 6, 2020 · Backend Development

Understanding Spring Controller Bean Scope: Singleton vs Prototype and Thread Safety

This article explains why Spring MVC controllers are singleton by default, demonstrates the thread‑safety issues caused by shared instance variables, shows how to test the behavior with sample code, and presents solutions such as using prototype scope, avoiding member variables, or employing ThreadLocal.

Bean ScopeControllerSingleton
0 likes · 6 min read
Understanding Spring Controller Bean Scope: Singleton vs Prototype and Thread Safety
Programmer DD
Programmer DD
Aug 6, 2020 · Backend Development

When to Use @Validated vs @Valid for Nested Validation in Spring

This article explains the differences between Spring's @Validated and the standard @Valid annotations, covering grouping support, where each can be applied, and how to enable nested validation for complex objects in controller parameters.

BackendNested Validationannotations
0 likes · 6 min read
When to Use @Validated vs @Valid for Nested Validation in Spring
Programmer DD
Programmer DD
Aug 6, 2020 · Backend Development

Mastering Spring @Transactional: Exception Types and Rollback Strategies

This article explains Java exception classifications, how Spring's @Transactional handles checked and unchecked exceptions, and provides practical configurations to control transaction rollbacks, while offering best‑practice notes on annotation placement and method design.

Exception Handlingspringtransaction
0 likes · 6 min read
Mastering Spring @Transactional: Exception Types and Rollback Strategies
Programmer DD
Programmer DD
Jul 30, 2020 · Backend Development

When to Use Apache vs Spring BeanUtils for Java Object Copying

This article explains the differences between Apache BeanUtils and Spring BeanUtils for copying Java objects, covering shallow vs deep copy concepts, performance drawbacks of Apache's implementation, usage examples, and recommendations for alternative tools like CGLIB BeanCopier and Orika.

ApacheBeanUtilsDeepCopy
0 likes · 9 min read
When to Use Apache vs Spring BeanUtils for Java Object Copying
FunTester
FunTester
Jul 30, 2020 · Backend Development

Why a Misused Transaction Propagation Caused Connection Exhaustion and How to Fix It

A Java Spring service method misused map.contains and REQUIRES_NEW transaction propagation, leading to unreleased DB connections and a CannotCreateTransactionException, and the article walks through the bug, its root causes, and concrete fixes including correct key checks and timeout settings.

concurrencydatabasedebugging
0 likes · 7 min read
Why a Misused Transaction Propagation Caused Connection Exhaustion and How to Fix It
Selected Java Interview Questions
Selected Java Interview Questions
Jul 27, 2020 · Backend Development

Understanding Spring Controller Scope and Thread Safety

The article explains why Spring MVC controllers are singleton by default, demonstrates the resulting thread‑unsafe behavior with example code, shows how applying @Scope("prototype") makes them prototype scoped, and provides best‑practice recommendations and a summary of Spring bean scopes.

ControllerSingletonbean
0 likes · 5 min read
Understanding Spring Controller Scope and Thread Safety
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jul 27, 2020 · Backend Development

Detailed Guide to Using @EnableAsync and @Async for Asynchronous Bean Method Execution in Spring

This article provides a comprehensive explanation of Spring's @EnableAsync and @Async annotations, covering their purpose, usage steps, handling of return values, custom thread‑pool configuration, exception handling, thread‑pool isolation, and the underlying AOP mechanism, supplemented with complete code examples.

AsyncThreadPoolconcurrency
0 likes · 18 min read
Detailed Guide to Using @EnableAsync and @Async for Asynchronous Bean Method Execution in Spring
Programmer DD
Programmer DD
Jul 27, 2020 · Backend Development

Why MyBatis Outperforms Hibernate for Modern Java Back‑End Projects

The article examines a Spring‑related Twitter poll, Google Trends, and Stack Overflow statistics to compare MyBatis, Hibernate, and JPA, then argues that MyBatis’ simplicity and flexibility make it better suited for today’s fast‑paced backend development.

HibernateMyBatisORM
0 likes · 5 min read
Why MyBatis Outperforms Hibernate for Modern Java Back‑End Projects
Programmer DD
Programmer DD
Jul 26, 2020 · Backend Development

How Does Spring Parse @Component and @Service Annotations? A Deep Dive

This article explains the internal workflow of Spring's annotation processing, detailing how @Component and its specializations like @Service are discovered through XML namespace handlers, classpath scanning, metadata readers, and meta‑annotation handling, complete with code excerpts and step‑by‑step analysis.

Annotation Processingcomponent scanningspring
0 likes · 12 min read
How Does Spring Parse @Component and @Service Annotations? A Deep Dive
Top Architect
Top Architect
Jul 21, 2020 · Backend Development

How Spring Solves Circular Dependencies and the Underlying Essence

This article explains how Spring resolves circular dependencies for singleton beans using a three‑level cache, demonstrates a simple prototype implementation, draws an analogy to the classic two‑sum algorithm, and highlights the core principle behind Spring's dependency injection mechanism.

BackendThree-level Cachecircular-dependency
0 likes · 9 min read
How Spring Solves Circular Dependencies and the Underlying Essence
Selected Java Interview Questions
Selected Java Interview Questions
Jul 18, 2020 · Backend Development

Deep Dive into Spring IOC Container Initialization Process

This article provides a comprehensive, step‑by‑step analysis of how Spring's IoC container is initialized, covering resource loading, BeanDefinition creation, BeanFactory setup, template‑method refresh logic, and practical debugging tips, all illustrated with UML diagrams and code snippets.

BackendDesign PatternsIoC
0 likes · 20 min read
Deep Dive into Spring IOC Container Initialization Process
Architecture Digest
Architecture Digest
Jul 18, 2020 · Backend Development

Understanding How Spring Handles Circular Dependencies and Its Core Principle

This article explains Spring's three‑level cache mechanism for resolving circular dependencies in singleton beans, demonstrates a simplified implementation with Java code, draws an analogy to the classic two‑sum algorithm, and highlights the essential idea behind circular dependency handling.

circular-dependencydependency-injectiondesign pattern
0 likes · 9 min read
Understanding How Spring Handles Circular Dependencies and Its Core Principle
Programmer DD
Programmer DD
Jun 29, 2020 · Backend Development

Why Spring Beans Aren’t Thread‑Safe and How ThreadLocal Solves It

This article explains that Spring does not guarantee thread safety for its beans, describes the various bean scopes, clarifies why stateless singleton beans are safe, and shows how ThreadLocal works—including its implementation, usage, and potential memory‑leak pitfalls—so developers can write correct concurrent code.

ThreadLocalconcurrencyjava
0 likes · 17 min read
Why Spring Beans Aren’t Thread‑Safe and How ThreadLocal Solves It
FunTester
FunTester
Jun 20, 2020 · Backend Development

Mastering MySQL CASE WHEN and MyBatis Dynamic Queries for Test Case Search

This article walks through building complex test‑case search queries using MySQL CASE WHEN, FIND_IN_SET, and MyBatis dynamic SQL, demonstrates converting asynchronous data fetches to synchronous calls with CountDownLatch in Spring, and provides complete Java bean and configuration examples.

AsyncBackendMyBatis
0 likes · 9 min read
Mastering MySQL CASE WHEN and MyBatis Dynamic Queries for Test Case Search
Beike Product & Technology
Beike Product & Technology
Jun 18, 2020 · Databases

Resolving Duplicate Income Splitting in a Financial System: Transaction Isolation, Spring Propagation, and Redis Lock

This article analyzes a financial system's duplicate income‑splitting bug caused by concurrent transactions, explains how MySQL isolation levels and Spring transaction propagation contributed to dirty reads, and presents two corrective approaches—adjusting transaction propagation and repositioning Redis locks—to ensure reliable data consistency.

databasemysqlredis
0 likes · 10 min read
Resolving Duplicate Income Splitting in a Financial System: Transaction Isolation, Spring Propagation, and Redis Lock