Java / Micronaut Interview questions
What are Micronaut beans?
A bean in Micronaut is any class the ApplicationContext manages: it decides when to create it, what scope it lives in, and what gets injected into it.
A class becomes a bean by carrying a scope annotation (@Singleton, @Prototype, @RequestScope, etc.), by being produced from a @Factory method, or by matching a type Micronaut auto-registers, such as a @Controller or @Client interface.
Every bean has an associated compile-time generated BeanDefinition that records its constructor, injected fields or methods, qualifiers, and any AOP advice that applies to it, which is what lets the container assemble object graphs without reflecting over the class at runtime.
More Related questions...