Spring Boot & Quarkus Integration
To deploy the Intuitive DSL Engine in a production-grade environment, manual registration of every command is often inefficient. By leveraging Inversion of Control (IoC) containers like Spring or Quarkus, you can automate the lifecycle of your DSL and inject managed beans directly into your command logic.
1. Automatic Command Registration
In a standard Spring Boot or Quarkus application, you can automatically register all your @DslCommand classes by collecting them from the application context. This ensures that adding a new feature to your CLI is as simple as creating a new class.
@Bean
public IntuitiveDslEngine intuitiveDslEngine(List<Object> dslCommands) {
IntuitiveDslEngine engine = new IntuitiveDslEngine();
// Automatically register all beans annotated with @DslCommand
dslCommands.stream()
.filter(bean -> bean.getClass().isAnnotationPresent(DslCommand.class))
.forEach(engine::register);
return engine;
}
2. Injecting Services into Dynamic Macros
One of the most powerful integration patterns is using Spring Data Repositories or Quarkus Panache Entities within your registerMacro calls. This allows your grammar to validate input against live database records in real-time.
@Bean
public IntuitiveDslEngine intuitiveDslEngine(RoleRepository roleRepo) {
IntuitiveDslEngine engine = new IntuitiveDslEngine();
engine.registerMacro("db_roles", registry -> roleRepo.findAllNames());
return engine;
}
3. Thread-Safety and Request Scoping
Because the Intuitive DSL Engine compiles its Symbol Graph (AST) into an immutable structure at startup, it is natively thread-safe. You can safely share a single IntuitiveDslEngine bean across multiple web requests or concurrent CLI sessions.
Swiss Quality Assurance: The engine’s zero-dependency architecture ensures that integrating iDSL will never cause "Classpath Hell" or version conflicts with your existing framework stack.
4. Executing with Context
When executing a command within a web framework, use the ExecutionContext to pass security principals or transaction IDs. This allows your commands to perform permission checks before execution.
public void handleRequest(String userInput) {
ExecutionContext context = ExecutionContext.createDefault();
context.put("currentUser", authService.getCurrentUser());
// Execution is safe, deterministic, and context-aware
engine.execute(userInput, context);
}
Next Steps
Now that your engine is integrated, explore how it provides Compiler-Grade Feedback to users through our Error Handling guide.