Performance: @Service annotation
MEDIUM IMPACT
This affects application startup time and memory usage by managing service bean creation and lifecycle.
@Service public class UserService { public void process() { /* logic */ } } // Injected by Spring where needed
public class UserService { public void process() { /* logic */ } } // Instantiated manually in controllers or other classes
| Pattern | Bean Management | Startup Impact | Memory Usage | Verdict |
|---|---|---|---|---|
| Manual Instantiation | No container management | Slower due to repeated creation | Higher due to multiple instances | [X] Bad |
| @Service Annotation | Singleton managed by Spring | Faster startup with reuse | Lower due to single instance | [OK] Good |