Phase 4: Spring Ecosystem — Enterprise Microservices with Spring & Spring Boot¶
Master the Spring framework from first principles: IoC container internals, dependency injection mechanics, Spring Data JPA, REST API design, security, MVC web layers, advanced ORM relationships, and Aspect-Oriented Programming — building real production-grade systems at every step.
Duration: 10 Weeks
Primary Course: Chad Darby's Spring Boot 3 & Spring 6 for Beginners
Companion Book: Spring in Action (6th Edition) — Craig Walls (Manning, 2022)
Learning Resources¶
| Label | Resource | Coverage |
|---|---|---|
| Course | Chad Darby — Spring Boot 4, Spring 7 & Hibernate for Beginners | Primary lecture content, all 10 sections |
| Book A | Spring in Action (6th Ed.) — Craig Walls | Ch 1–3, 5–8, 10, 15 |
| Lab Repo | darbyluv2code/spring-boot-4-spring-7-hibernate-for-beginners | Sections 01–11 |
Daily Time Budget: 2.5–3.0 hours/day split as: - 45–60 min — Core theory & lecture walkthrough - 30–45 min — Spring in Action book reading - 60–75 min — Practical engineering lab
Weeks¶
-
Week 1 — Spring Boot Core Foundations
Bootstrap projects with Spring Initializr, understand Maven build lifecycle, master auto-configuration, DevTools hot-reload, Actuator production endpoints,
@Valueproperty injection, and server configuration.Books: Spring in Action Ch 1 · Ch 18.1-18.2
Lab Guide: Enterprise Service Metadata & Health Gateway
Lab Repo: 7amo10/Spring-Labs — Week-01 -
:material-injection-syringe:{ .lg .middle } Week 2 — Spring Core: IoC, DI & Bean Lifecycle
Dissect the IoC container, compare constructor vs setter vs field injection, resolve multi-implementation ambiguity with
@Qualifier/@Primary, manage bean scopes, implement lifecycle hooks, and wire 3rd-party classes via Java@Configuration.Books: Spring in Action Ch 1.1-1.2 · Ch 6.1-6.3
Lab Guide: Dynamic Athletic Dispatcher & 3rd-Party Adapter
Lab Repo: 7amo10/Spring-Labs — Week-02 -
Week 3 — Hibernate / JPA Data Access & DAO Layer
Bridge domain models to relational databases with Jakarta Persistence and Hibernate: entity lifecycle,
EntityManagertransactions, JPQL queries, dirty checking, DDL auto generation, and DAO layer patterns.Books: Spring in Action Ch 3
Lab Guide: Student Information System DAO Tier
Lab Repo: 7amo10/Spring-Labs — Week-03 -
Week 4 — RESTful Services & Error Handling
Design and build production-grade REST APIs with Spring MVC:
@RestController, HTTP verb semantics, Jackson data binding, global error handling via@ControllerAdvice, 3-tier layering with service transactions, and partial resource modifications viaPATCH.Books: Spring in Action Ch 7 (pp. 163–174)
Lab Guide: Corporate Enterprise Employee REST Gateway
Lab Repo: 7amo10/Spring-Labs — Week-04 -
Week 5 — Spring Data JPA, REST & OpenAPI
Eliminate DAO boilerplate with Spring Data JPA dynamic proxy repositories, leverage derived query methods, auto-generate hypermedia REST APIs with Spring Data REST, and integrate interactive Swagger UI documentation.
Books: Spring in Action Ch 3.2.2–3.2.4 · Ch 7.2
Lab Guide: Automated Paginated Fleet Management Service
Lab Repo: 7amo10/Spring-Labs — Week-05 -
Week 6 — Stateless REST Security & RBAC
Secure REST APIs with Spring Security 6/7: stateless HTTP Basic authentication, BCrypt cryptographic password hashing, role-based access control (RBAC), and relational database authentication via
JdbcUserDetailsManager.Books: Spring in Action Ch 5 · Ch 8
Lab Guide: Tiered Access REST Security Shield
Lab Repo: 7amo10/Spring-Labs — Week-06 -
Week 7 — Spring MVC Web & Bean Validation
Build server-side rendered web applications using Spring MVC and Thymeleaf:
DispatcherServletfront controller lifecycle, bidirectional form model data binding (th:object,th:field), input sanitization via@InitBinderandStringTrimmerEditor, declarative validation via Jakarta Bean Validation (@NotNull,@Size,@Min,@Max,@Pattern), and developing custom constraints (@CorporateEmail).Books: Spring in Action Ch 2 (Sections 2.1–2.3)
Lab Guide: Corporate Registration Portal with Custom Constraint Validation
Lab Repo: 7amo10/Spring-Labs — Week-07 -
Week 8 — Full-Stack MVC CRUD & Form-Based Security
Construct a production-grade full-stack web application: integrate Spring MVC controllers with Spring Data JPA repositories, eliminate duplicate submissions with the Post-Redirect-Get (PRG) pattern, configure custom Bootstrap 5 form login and logout flows, apply synchronized CSRF defenses, establish multi-tiered RBAC, and adapt dynamic UI elements via the Thymeleaf Spring Security 6 dialect.
Lab Guide: Secure Enterprise Employee Administration Portal
Lab Repo: 7amo10/Spring-Labs — Week-08 -
Week 9 — Advanced JPA Relational Mappings
Master complex entity relationships in Jakarta Persistence (JPA) and Hibernate: 1:1 bidirectional associations with
mappedBy, 1:N bidirectional mapping, 1:N unidirectional collections, and M:N networks with@JoinTable. Eliminate N+1 select queries with JPQLJOIN FETCHand enforce programmatic foreign key dissociation protocols before deletion.Lab Guide: University Academic & Course Enrollment Domain Model
Lab Repo: 7amo10/Spring-Labs — Week-09 -
Week 10 — Aspect-Oriented Programming (AOP) & Spring Boot 4
Decouple cross-cutting technical concerns with Spring AOP runtime dynamic proxies. Master pointcut expressions, reusable catalogs, noise filtering,
@Orderprecedence, and all five advice types (@Before,@AfterReturning,@AfterThrowing,@After,@Around). Navigate the self-invocation trap, explore Spring Integration, and implement Spring Boot 4 declarative URL path-segment API versioning.Books: Spring in Action Ch 10 (EIP) · Ch 15 (Actuator)
Lab Guide: Automated Cross-Layer Security Audit & Execution Profiler
Lab Repo: 7amo10/Spring-Labs — Week-10 -
Week 11 — Enterprise Spring Security Architecture & Perimeters
Master the runtime architecture of Spring Security 6/7: deconstruct servlet filter dispatch (
DelegatingFilterProxy,FilterChainProxy), architect customAuthenticationProviderimplementations, inject custom servlet filters, implement adaptive cryptographic password management withDelegatingPasswordEncoderandCompromisedPasswordChecker, and establish defenses against CORS and CSRF across Single-Page Application (SPA) architectures.Lab Guide: Enterprise Banking Security Perimeter & Filter Pipeline
Lab Repo: 7amo10/Spring-Labs — Week-11
Phase 4 Architecture¶
flowchart TD
P3["Phase 3 - Jakarta EE 10<br/>helix-cortex capstone"]
subgraph FOUNDATIONS["Weeks 1-2: Spring Foundations"]
BOOT["Week 1 - Spring Boot<br/>Auto-config / Actuator<br/>Maven / DevTools"]
CORE["Week 2 - Spring Core<br/>IoC / DI / Scopes<br/>Bean Lifecycle"]
end
subgraph DATA["Weeks 3-5: Data Layer"]
JPA["Week 3 - Hibernate/JPA<br/>EntityManager / JPQL<br/>DAO Pattern"]
REST["Week 4 - REST APIs<br/>@RestController<br/>ExceptionHandler"]
SDATA["Week 5 - Spring Data<br/>JpaRepository / Paging<br/>OpenAPI"]
end
subgraph SECURITY["Week 6: Security"]
SEC["Spring Security<br/>BCrypt / RBAC<br/>UserDetailsService"]
end
subgraph WEB["Weeks 7-8: MVC Web"]
MVC["Week 7 - Spring MVC<br/>Thymeleaf / Validation"]
CRUD["Week 8 - Full-Stack CRUD<br/>Auth Guards / Roles"]
end
subgraph ADVANCED["Weeks 9-10: Advanced"]
ORM["Week 9 - Advanced ORM<br/>OneToMany / ManyToMany<br/>Cascade / Fetch"]
AOP["Week 10 - AOP<br/>@Aspect / Pointcuts<br/>@Around advice"]
end
P3 --> FOUNDATIONS
FOUNDATIONS --> DATA
DATA --> SECURITY
SECURITY --> WEB
WEB --> ADVANCED
Phase Progress¶
Week 1 — Spring Boot Core Foundations
- Spring Boot overview and philosophy
- Spring Initializr and Maven project structure
- Spring Boot Starters and parent BOM
- DevTools hot reload
- Actuator endpoints and security
- Command-line execution (fat JAR)
- @Value property injection
- Server configuration via application.properties
- Week 1 Lab: Enterprise Service Metadata & Health Gateway
Week 2 — Spring Core: IoC, DI & Bean Lifecycle
- Inversion of Control and the Spring Container
- Constructor injection (recommended)
- Setter injection and field injection
- Component scanning and @Component
- @Qualifier and @Primary for ambiguity resolution
- @Lazy initialization
- Singleton vs Prototype bean scopes
- @PostConstruct and @PreDestroy lifecycle hooks
- Java Config (@Configuration + @Bean)
- Week 2 Lab: Dynamic Athletic Dispatcher & 3rd-Party Adapter Service
Week 3 — Hibernate / JPA Data Access & DAO Layer
- Entity mapping:
@Entity,@Table,@Id,@GeneratedValue,@Column - Spring Boot auto-configuration for JPA and DataSource
- DAO architecture and
EntityManagerconstructor injection - CRUD operations:
persist(),find(),merge(),remove() - JPQL queries:
TypedQuery, filtering, sorting, named parameters - In-memory dirty checking vs explicit
merge() - Bulk JPQL DML and First-Level Cache eviction considerations
- Hibernate DDL auto schema generation (
spring.jpa.hibernate.ddl-auto) - Week 3 Lab: Student Information System DAO Tier
Week 4 — RESTful Services & Error Handling
- REST architecture constraints and HTTP verb semantics
- Jackson JSON serialization (getters) and deserialization (setters/constructors)
-
@RestControllerand URI routing with@PathVariable - Controller-local vs Global exception handling (
@ControllerAdvice) - Enterprise 3-tier layering (Controller -> Service -> DAO)
- Service-tier transaction demarcation with
@Transactional - Defensive
POSTprimary key reset (setId(0)) - Partial entity modification via HTTP
PATCHand JacksonJsonMapper - Week 4 Lab: Corporate Enterprise Employee REST Gateway
Week 5 — Spring Data JPA, Automated Repositories & Spring Data REST
- Refactoring custom DAOs to
JpaRepository<Employee, Integer> - Spring Data JPA dynamic runtime proxy generation
- Derived query methods and method name parsing grammar
- Custom JPQL queries with
@Queryand@Param - Hypermedia APIs via Spring Data REST (
spring-boot-starter-data-rest) - HATEOAS HAL wire representation (
_embedded,_links,page) - Overriding base paths and collection paths with
@RepositoryRestResource - Client-controlled pagination (
?page=0&size=5) and sorting (?sort=lastName,desc) - Automated interactive documentation via OpenAPI 3 & Swagger UI (
springdoc-openapi) - Week 5 Lab: Automated Paginated Fleet Management Service
Week 6 — Stateless REST Security & RBAC
- Spring Security architecture,
DelegatingFilterProxy, andFilterChainProxy - Declaring custom
SecurityFilterChainbean via modern Lambda DSL - Stateless HTTP Basic authentication and Base64 header decoding
- Why CSRF is disabled for non-browser stateless REST APIs
- In-memory user provisioning with
InMemoryUserDetailsManager - Roles vs Authorities mental model and prefix rules (
ROLE_) - Granular route authorization by HTTP method (
GET,POST,PUT,PATCH,DELETE) - Relational database authentication via
JdbcUserDetailsManager - Standard Spring Security database schema (
usersandauthorities) - Cryptographic password hashing using salted BCrypt (
BCryptPasswordEncoder) - Adapting non-standard custom schemas via
setUsersByUsernameQuery() - Week 6 Lab: Tiered Access REST Security Shield
Week 7 — Spring MVC Web Architecture, Thymeleaf & Form Validation
- Front Controller pattern and
DispatcherServletinternal processing lifecycle -
@Controllervs@RestControllerandModeldata dictionary contract - Request parameter extraction:
@RequestParamvs low-levelHttpServletRequest - Natural templating with Thymeleaf and expression evaluation syntax
- Bidirectional form data binding via form-backing beans (
th:object,th:field) - Dynamic dropdown selects, radio buttons, and checkboxes from external property files
- Declarative integrity constraints via Jakarta Bean Validation (JSR-380)
- Enforcing
@Validand strictBindingResultparameter adjacency rules - Input sanitization and whitespace bypass prevention with
@InitBinderandStringTrimmerEditor - Localized type mismatch error handling via
messages.properties - Authoring custom validation annotations (
@CorporateEmail) andConstraintValidator - Week 7 Lab: Corporate Registration Portal with Custom Constraint Validation
Week 8 — Full-Stack Spring MVC CRUD & Form-Based Security
- Multi-tier full-stack architecture: Controller \(\rightarrow\) Service \(\rightarrow\) Repository \(\rightarrow\) Database
- Spring Data JPA derived sorting queries (
findAllByOrderByLastNameAsc()) - Add entity workflow with pre-populated form-backing model bean
- Post-Redirect-Get (PRG) pattern eliminating duplicate form submissions on browser refresh
- Update entity workflow with primary key preservation via hidden ID input field
- Safe deletion workflows with confirmation modals and PRG redirects
- Custom form-based login replacing HTTP Basic with Bootstrap 5 card layouts
- Login failure handling via
?errorparameter and contextual alert rendering - Secure
POST /logouthandling with session invalidation, cookie clearing, and?logoutconfirmation - Synchronized CSRF token enforcement and automatic Thymeleaf
_csrfform injection - Multi-tier Role-Based Access Control (RBAC) across
EMPLOYEE,MANAGER, andADMIN - Custom HTTP 403 access-denied view routing and active principal context display
- Dynamic UI action button adaptation using Thymeleaf Spring Security 6 dialect (
sec:authorize) - Production database authentication via
JdbcUserDetailsManagerwith custom table queries - Week 8 Lab: Secure Enterprise Employee Administration Portal
Week 9 — Advanced JPA & Hibernate: Relational Topologies & Fetch Optimization
- Symmetrical 1:1 bidirectional mapping with
mappedByand foreign key placement rules - Fine-tuning
CascadeTypepolicies (ALL vs PERSIST, MERGE, DETACH, REFRESH) - Child-only deletion and programmatic foreign key dissociation protocols
- 1:N and N:1 bidirectional associations with symmetrical convenience synchronization methods
- Safe deletion in 1:N graphs preserving un-cascaded entities via foreign key nullification
- Fetch strategies:
FetchType.EAGERvsFetchType.LAZYand JPA default fetch rules - Hibernate runtime bytecode proxies (
PersistentBag) andLazyInitializationExceptionanatomy - The N+1 select query problem: mathematical explosion and performance impact
- Eliminating N+1 queries with single-statement JPQL
JOIN FETCHgraph retrieval - 1:N unidirectional mapping (
Course\(\rightarrow\)Review) with parent-level@JoinColumn - Full lifecycle delegation with
CascadeType.ALLon composite child entities - M:N bidirectional mapping (
Course\(\leftrightarrow\)Student) via@JoinTable - The Peer Entity Preservation Rule: why
CascadeType.REMOVEis prohibited in@ManyToMany - Safe deletion and dissociation in join tables when removing owning vs inverse entities
- Week 9 Lab: University Academic & Course Enrollment Domain Model
Week 10 — Aspect-Oriented Programming (AOP), Production Telemetry & Spring Boot 4 Updates
- Spring AOP dynamic proxy architecture: JDK Dynamic Proxies vs CGLIB bytecode subclasses
- AspectJ pointcut expression grammar (
execution(...)), return type, package, and parameter wildcards (*,..) - Centralized reusable pointcut catalogs with
@Pointcutand Boolean composition (&&,||,!) - Noise filtering patterns: excluding getter and setter accessors from persistence pointcuts
- Enforcing aspect precedence across multi-tier pipelines using
@Order(int) - Runtime method introspection and argument inspection via
JoinPointandMethodSignature - In-place domain data post-processing and PII masking with
@AfterReturning - Failure telemetry interception and exception propagation semantics with
@AfterThrowing - Deterministic resource cleanup with
@After(finally) advice - High-precision latency profiling and SLA violation alerting using
@AroundwithProceedingJoinPoint - Three-tier enterprise logging across Controller, Service, and DAO layers without business code intrusion
- Diagnosing and solving the internal self-invocation proxy bypass trap
- Spring Boot 4 / Spring Framework 7 declarative URL path-segment API versioning (
spring.mvc.apiversion.use.path-segment=1) - Spring Integration enterprise patterns (channels, filters, transformers, routers, service activators)
- Production observability and custom metrics with Spring Boot Actuator and Micrometer
- Week 10 Lab: Automated Cross-Layer Security Audit & Execution Profiler
Week 11 — Enterprise Spring Security: Filter Chains, Custom Providers, RBAC, CORS & CSRF
- Security architecture fundamentals: CIA Triad, AAA model, and default security auto-configuration
- The Servlet Filter bridge:
DelegatingFilterProxydelegation toFilterChainProxy(springSecurityFilterChain) - Modern component-based
SecurityFilterChainbean declaration replacingWebSecurityConfigurerAdapter - Declarative route authorization rules via
authorizeHttpRequests()andrequestMatchers() - Fail-secure posture with explicit
anyRequest().denyAll()vspermitAll() - Dual client entrypoints: Form Login session workflow vs stateless HTTP Basic Authentication
- Identity retrieval contracts:
UserDetailsService(read-only query) vsUserDetailsManager(CRUD lifecycle) - The
UserDetailscontract and evaluation of account state invariants (isEnabled,isAccountNonLocked) - In-memory identity provisioning with
InMemoryUserDetailsManagerandUser.withUsername()builder - Overcoming JDBC schema limitations with Spring Data JPA and custom entity-backed
UserDetailsService - Customer self-registration REST endpoint with cryptographic password hashing
- Cryptographic taxonomy: encoding (Base64) vs encryption (AES) vs one-way hashing (BCrypt, Argon2)
- Rainbow table mitigation using cryptographically secure unique salts per password
- Hardware-accelerated brute-force mitigation using adaptive work factor tuning (cost factor \(\ge 12\))
- Zero-downtime cryptographic migration via
DelegatingPasswordEncoderand algorithm prefix identifiers - Screening user credentials against public breach databases using Spring Security 6.3+
CompromisedPasswordChecker - Decoupling credential validation from identity loading by implementing custom
AuthenticationProvider -
ProviderManagermulti-provider iteration and token matching viasupports(Class<?>) - Environment-specific provider isolation using Spring
@Profile("prod")vs@Profile("!prod") - Uniform JSON API error payloads using custom
AuthenticationEntryPoint(401) andAccessDeniedHandler(403) - Session fixation defense via
sessionFixation(sf -> sf.changeSessionId()) - Concurrent login prevention and session limits using
.maximumSessions(1).maxSessionsPreventsLogin(true) - Capturing live security success and failure audit events via asynchronous
@EventListenermethods - Browser Same-Origin Policy (SOP) fundamentals and preflight
OPTIONSrequest handshakes - Restrictive CORS configuration with allowed origins, methods, credentials, and preflight max-age caching
- Cross-Site Request Forgery (CSRF) threat analysis and the Synchronizer Token Pattern
- Solving the Spring Security 6 deferred CSRF token trap for SPAs using custom
CsrfCookieFilter - Week 11 Lab: Enterprise Banking Security Perimeter with Custom AuthenticationProvider & Filter Pipeline
Phase 4 Start Date: 2026-10-01 | Target Completion: 2026-12-10