Performance: Multi-module project structure
This affects the initial build time and the size of the deployed application, which impacts page load speed and server response time.
Split the project into multiple Maven or Gradle modules, each with focused responsibilities and dependencies.
Single large Spring Boot project with all features and dependencies in one module (monolith).
| Pattern | Build Time | Server Startup | Artifact Size | Verdict |
|---|---|---|---|---|
| Monolithic single module | Long (full rebuild every time) | Slow (large JAR to load) | Large (all features bundled) | [X] Bad |
| Multi-module structure | Shorter (incremental builds) | Faster (smaller modules) | Smaller (focused artifacts) | [OK] Good |
pom.xml controls all modules.application.properties configure app settings, not modules.pom.xml -> Option Dcore and web, where web depends on core, what happens if core is not built before web?web depends on core, it needs core built first to access its code.web without core causes missing dependency errors and build failure.web module build will fail due to missing dependencies -> Option Aweb module cannot find classes from the core module. What is the most likely cause?web cannot find core classes, it likely lacks a dependency declaration on core.core as a dependency in web's pom.xml fixes class visibility.core module is not listed as a dependency in web's pom.xml -> Option Acommon module for shared utilities.common as a dependency to access shared code cleanly.common module and add it as a dependency to other modules -> Option BPass the test and this pattern moves unknown