This page provides a comprehensive introduction to the Solon Framework, covering its design philosophy, key features, architectural overview, and core components. It is intended for developers evaluating Solon for enterprise application development or beginning their journey with the framework.
For detailed module organization and Maven structure, see Project Structure and Module Organization. For hands-on setup instructions, see Getting Started.
Sources: README.md1-120 README_CN.md1-120 README_EN.md1-120
Solon is a Java enterprise application development framework designed for full-scenario coverage, built from scratch with a focus on restraint, efficiency, and openness. Unlike traditional Java EE frameworks, Solon is not based on the Servlet specification, allowing it to achieve superior performance and resource efficiency.
The framework supports JDK versions 8 through 25 and includes native image compilation support via GraalVM, enabling deployment across diverse runtime environments from traditional JVMs to cloud-native containers.
Key Statistics:
Sources: Solon.java48-66 README.md63-70 solon-parent/pom.xml1-33
Solon's core framework maintains a minimal footprint by limiting dependencies to essential libraries: slf4j-api, jspecify, eggg (metadata builder), and solon-expression. The framework size is intentionally kept small, with the core solon.jar containing only necessary abstractions.
The framework achieves efficiency through:
Solon provides extensive extensibility through:
Sources: Solon.java34-47 solon/pom.xml18-48 SolonProps.java28-46
| Category | Feature | Specification |
|---|---|---|
| Performance | Concurrency | 700% improvement over traditional frameworks |
| Memory Usage | 50% reduction | |
| Startup Time | 10x faster (sub-second for typical applications) | |
| Deployment | Package Size | 90% smaller JAR artifacts |
| JDK Support | Java 8, 11, 17, 21, 25 | |
| Runtime | JVM and GraalVM Native Image | |
| Development | Code Volume | Reduced boilerplate through annotations and conventions |
| Learning Curve | Simplified APIs and clear documentation | |
| Debugging | Fast startup enables rapid iteration | |
| Architecture | Design | Non-Java EE, built from scratch |
| Server Support | 7+ HTTP server implementations | |
| Modularity | Multi-module Maven structure with clear separation |
Sources: README.md55-70 Solon.java58-65 solon-parent/pom.xml73-90
The Solon Framework is organized into four primary architectural layers, each with distinct responsibilities:
Application Layer: Manages the entire application lifecycle, from initialization through shutdown. The Solon class provides static access to the global SolonApp instance, which orchestrates configuration loading, plugin execution, and bean scanning.
Dependency Injection Layer: Implements IoC container functionality through AppContext and BeanContainer. Supports annotation-driven configuration, constructor/field/method injection, and lifecycle management.
Request Processing Layer: Handles HTTP requests through a flexible pipeline. The Context interface provides server-agnostic request/response abstractions, while Router and ChainManager coordinate routing and filtering.
Extension System: Enables dynamic extensibility through the Plugin interface and ServiceLoader discovery. The ExtendLoader supports both global and isolated class loading for JAR files.
Cross-Cutting Services: Provides reusable managers for rendering (templates, JSON), serialization, type conversion, and factory patterns.
Sources: SolonApp.java58-194 Solon.java48-111 SolonProps.java40-220
This diagram maps the primary Solon components to their concrete implementations in the codebase:
| Class | Package | Role |
|---|---|---|
Solon | org.noear.solon | Static application entry point, global instance holder |
SolonApp | org.noear.solon | Main application class, lifecycle coordinator |
SolonProps | org.noear.solon | Configuration loader and property manager |
AppContext | org.noear.solon.core | IoC container, bean builder and injector |
BeanContainer | org.noear.solon.core | Bean storage with subscription mechanism |
Context | org.noear.solon.core.handle | Request/response abstraction |
Router | org.noear.solon.core.route | Path matching and action routing |
Plugin | org.noear.solon.core | Extension interface for plugins |
ExtendLoader | org.noear.solon.core | Dynamic JAR loader with isolation support |
Sources: Solon.java48-271 SolonApp.java58-665 SolonProps.java47-750
The Solon application follows a well-defined initialization sequence:
The framework publishes the following events during startup:
init()start()For detailed lifecycle management, see Application Lifecycle.
Sources: SolonApp.java244-418 Solon.java164-271 SolonProps.java72-220
Solon's configuration system follows a hierarchical loading strategy:
--solon.app.name=myapp. (e.g., solon.app.name)System.setProperty("solon.app.name", "myapp")app.properties, app.ymlapp-{env}.properties, app-{env}.ymlsolon.config.load propertysolon.config.add command-line argumentSolon supports property expressions with default values and nesting:
${server.port}${server.port:8080}${db.url.${env}}${.subkey} (within same property prefix)For complete configuration documentation, see Configuration System.
Sources: SolonProps.java72-249 Props.java40-194 PropUtil.java26-170
Solon uses a Maven multi-module structure organized into logical categories:
| Module Category | Examples | Version | Purpose |
|---|---|---|---|
| Core | solon, solon-mvc, solon-server, solon-data | 3.8.3 | Framework kernel and base functionality |
| Extensions | solon-ai, solon-flow, solon-cloud, solon-admin | 3.8.3 | Specialized capabilities (AI, workflow, cloud-native) |
| Integration | mybatis-solon-plugin, redis-solon-plugin, kafka-solon-plugin | 3.8.3 | Third-party library adapters |
| Servers | solon-server-jetty, solon-server-undertow, solon-server-tomcat | 3.8.3 | HTTP server implementations |
| Serialization | solon-serialization-snack4, solon-serialization-jackson | 3.8.3 | Data format handlers |
| Environment | solon-java17, solon-java25 | 3.8.3 | JDK version-specific features |
The parent POM (solon-parent) provides unified dependency management, ensuring version consistency across all modules. The framework aggregates three top-level module groups:
__release: Artifacts and bundles for distribution__test: Integration tests and examples__hatch: Experimental features under developmentFor detailed module structure, see Project Structure and Module Organization. For module ecosystem details, see Module Ecosystem.
Sources: pom.xml1-43 solon-parent/pom.xml1-206 __test/pom.xml1-24
Solon's extension mechanism is based on the Plugin interface with ServiceLoader discovery:
Plugins implement the Plugin interface with four lifecycle methods:
init(AppContext context): Register beans, builders, injectors, and other extensionsstart(AppContext context): Activate services after all beans are loadedpreStop(): Begin graceful shutdown (e.g., deregister from service discovery)stop(): Final cleanup and resource releasePlugins can register custom behavior at six strategic integration points:
For detailed plugin architecture, see Plugin and Extension System.
Sources: SolonApp.java553-603 SolonProps.java376-435 PluginUtil.java1-150 (not shown but referenced)
Solon is particularly well-suited for:
The framework's low memory footprint and fast startup make it ideal for containerized microservice deployments where resource efficiency directly impacts infrastructure costs.
Native image support via GraalVM enables extremely fast cold starts (sub-millisecond) for serverless functions and cloud platforms like AWS Lambda, Azure Functions, or Google Cloud Run.
Small package sizes (90% reduction) and low resource requirements make Solon suitable for edge devices and IoT gateways with limited resources.
Despite its modern architecture, Solon supports traditional MVC patterns with template engines (Freemarker, Thymeleaf, Velocity, Beetl, Enjoy) and session management.
Server-agnostic design allows selection of high-performance HTTP servers (SmartHttp, Undertow) for applications requiring maximum throughput.
Extensive integration modules support popular frameworks: MyBatis, Redis, Kafka, RabbitMQ, MongoDB, Elasticsearch, gRPC, Dubbo, enabling gradual migration or hybrid architectures.
To begin developing with Solon, see Getting Started for:
Solon.start() initialization@Inject and @Component@Mapping and @ControllerFor project structure details, see Project Structure and Module Organization.
Sources: README.md108-114 Solon.java137-195 SolonApp.java210-268
Solon is a high-performance, lightweight Java framework built from scratch to address the limitations of traditional Java EE architectures. Its design emphasizes restraint (minimal dependencies), efficiency (optimized resource usage), and openness (extensive extensibility). The framework achieves remarkable performance improvements—700% higher concurrency, 50% memory savings, 10x faster startup—while maintaining compatibility with JDK 8 through 25 and supporting both JVM and native image runtimes.
The architecture consists of four primary layers: Application (lifecycle management), Dependency Injection (IoC container), Request Processing (server-agnostic HTTP handling), and Extension System (plugin-based extensibility). This modular design enables developers to select only the components they need, resulting in smaller deployments and faster application startup.
Solon's configuration system provides flexible property management with hierarchical loading and expression support, while its plugin system offers six strategic extension points for customizing framework behavior. The extensive module ecosystem includes integrations for popular libraries, multiple HTTP server implementations, and specialized capabilities like AI integration and workflow management.
Sources: README.md1-120 Solon.java48-271 SolonApp.java58-665
Refresh this wiki
This wiki was recently refreshed. Please wait 3 days to refresh again.