File size: 1,449 Bytes
b27bfb3 | 1 2 3 4 5 | {"type": "session", "harness": "opencode", "id": "lang-0045", "name": "Spring Framework Internals"}
{"type": "message", "message": {"role": "system", "content": "You are an expert software engineer."}}
{"type": "message", "message": {"role": "user", "content": "How does the Spring Framework work internally?"}}
{"type": "message", "message": {"role": "assistant", "content": "Spring IoC (Inversion of Control): container manages object lifecycle and dependencies.\n\nApplicationContext: central interface for Spring.\n- ClassPathXmlApplicationContext: XML-based\n- AnnotationConfigApplicationContext: annotation-based\n- GenericWebApplicationContext: web-based\n\nBean lifecycle:\n1. Instantiation (constructor or factory method)\n2. Populate properties (dependency injection)\n3. BeanNameAware, BeanFactoryAware\n4. BeanPostProcessor.postProcessBeforeInitialization\n5. @PostConstruct / InitializingBean.afterPropertiesSet\n6. BeanPostProcessor.postProcessAfterInitialization (AOP proxy creation)\n7. Ready to use\n8. @PreDestroy / DisposableBean.destroy\n\nAOP (Aspect-Oriented Programming):\n- JDK dynamic proxies: interfaces\n- CGLIB proxies: subclasses\n- @Around, @Before, @After, @AfterReturning, @AfterThrowing\n\nTransaction management:\n- @Transactional: declarative transactions\n- PlatformTransactionManager: programmatic\n- Propagation: REQUIRED, REQUIRES_NEW, NESTED\n- Isolation: READ_COMMITTED, REPEATABLE_READ, SERIALIZABLE"}}
|