Architecture Articles
7 articles about Architecture. Explore Spring Boot implementation, design, and operations across related topics.
-
When Should You Use BeanNameAware and ApplicationContextAware in Spring Boot?
Explains what BeanNameAware, BeanFactoryAware, ApplicationContextAware, and EnvironmentAware inject into a Bean and when they are called, with implementation examples. Organizes the criteria for deciding when to use them versus when to replace them with constructor injection.
-
How to Fix NoSuchBeanDefinitionException with @ComponentScan in Spring Boot - Configuring Multi-Module Setups and Scan Scope
This article diagnoses why a Bean placed in a different package or module fails to be registered, resulting in NoSuchBeanDefinitionException, and explains pattern-by-pattern solutions using scanBasePackages, explicit @ComponentScan, and multi-module configurations.
-
How to Create Your Own Custom Starter in Spring Boot - AutoConfiguration and Metadata Setup
A guide to promoting shared internal logging configuration and external API integration Beans into a custom Starter that activates simply by adding a dependency. From splitting the autoconfigure and starter modules, @AutoConfiguration, AutoConfiguration.imports registration, conditional configuration with @ConditionalOn, to @ConfigurationProperties and generating configuration metadata JSON, we build everything end-to-end in a hands-on manner.
-
Spring Boot Package Structure Best Practices - Choosing Between Layered and Feature-Based Approaches
For beginner to intermediate developers struggling with Spring Boot package structure, this guide compares the structure, benefits, and limitations of layered and feature-based approaches. It explains step by step how to choose based on project scale, how to maintain dependency direction, how to automatically test dependency rules with ArchUnit, and the path toward Spring Modulith.
-
How to Achieve a Modular Monolith with Spring Modulith
A practical guide to building a modular monolith using Spring Modulith 1.x. Explains defining package boundaries with @ApplicationModule, verifying boundaries with ApplicationModules.verify(), persisting events with the Event Publication Registry, and migration steps from existing ApplicationEvent implementations, all with concrete code examples.
-
How to Implement Multi-Tenancy in Spring Boot
A guide to implementing multi-tenancy (Database/Schema/Shared-schema) with Spring Boot 3.2 and Hibernate 6.4, explained with comparison tables and working code. Covers everything from MultiTenantConnectionProvider to tenant resolution Filters using JWT/headers.
-
MyBatis vs JPA in Spring Boot: Selection Criteria and Combined Usage Patterns [With Comparison Table]
Not sure whether to choose MyBatis or JPA for your Spring Boot project? This article organizes a comparison table covering SQL control flexibility, learning cost, performance, and maintainability, along with a practical decision flowchart, the difference between #{} and ${}, and concrete configuration examples for using both together. Get all the decision criteria in one place.