refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게 [공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류. 문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인). - Topic_Programming → Domain_Programming (내부 구조 보존) - Topic_Graphic → Domain_Design - Topic_Business → Domain_Product - Topic_General → Domain_General - _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning), Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing) - 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서) - 빈 폴더 정리 (memory/procedures) - 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,181 @@
|
||||
---
|
||||
id: wiki-2026-0508-spring-framework
|
||||
title: Spring Framework
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [Spring, Spring Boot, Spring Core]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [java, framework, dependency-injection, spring-boot]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: java
|
||||
framework: spring-boot
|
||||
---
|
||||
|
||||
# Spring Framework
|
||||
|
||||
## 매 한 줄
|
||||
> **"매 Java enterprise 의 IoC container — 매 Beans, AOP, MVC, Boot 의 ecosystem"**. Rod Johnson (2003) 의 J2EE 대체. 2026 현재 Spring Boot 3.4 (Java 21+, virtual threads, AOT/GraalVM native) 가 매 backend Java 의 de-facto.
|
||||
|
||||
## 매 핵심
|
||||
|
||||
### 매 IoC / DI
|
||||
- **ApplicationContext**: 매 Bean 의 lifecycle 관리.
|
||||
- **`@Component`, `@Service`, `@Repository`, `@Controller`**: 매 stereotype.
|
||||
- **Constructor injection**: 매 권장 (final field, immutability).
|
||||
|
||||
### 매 modules
|
||||
- **Spring Core**: IoC, DI, Resource, SpEL.
|
||||
- **Spring MVC / WebFlux**: HTTP (Servlet vs reactive).
|
||||
- **Spring Data**: JPA, MongoDB, Redis repository abstraction.
|
||||
- **Spring Security**: Auth (OAuth2, JWT, OIDC).
|
||||
- **Spring Boot**: 매 auto-configuration, embedded Tomcat/Netty.
|
||||
|
||||
### 매 응용
|
||||
1. REST API backend (Boot + Web + Data JPA).
|
||||
2. Reactive microservice (WebFlux + R2DBC).
|
||||
3. Batch job (Spring Batch).
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### Spring Boot 3.4 application
|
||||
```java
|
||||
@SpringBootApplication
|
||||
public class App {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(App.class, args);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Constructor injection 의 service
|
||||
```java
|
||||
@Service
|
||||
public class OrderService {
|
||||
private final OrderRepository repo;
|
||||
private final PaymentClient payments;
|
||||
|
||||
public OrderService(OrderRepository repo, PaymentClient payments) {
|
||||
this.repo = repo;
|
||||
this.payments = payments;
|
||||
}
|
||||
|
||||
public Order place(NewOrder cmd) {
|
||||
var charge = payments.charge(cmd.amount());
|
||||
return repo.save(new Order(cmd, charge.id()));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### REST controller (Java 21 records)
|
||||
```java
|
||||
@RestController
|
||||
@RequestMapping("/orders")
|
||||
public class OrderController {
|
||||
private final OrderService service;
|
||||
public OrderController(OrderService s) { this.service = s; }
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<Order> create(@Valid @RequestBody NewOrder cmd) {
|
||||
return ResponseEntity.status(201).body(service.place(cmd));
|
||||
}
|
||||
}
|
||||
|
||||
public record NewOrder(@NotBlank String sku, @Positive long amount) {}
|
||||
```
|
||||
|
||||
### Spring Data JPA repository
|
||||
```java
|
||||
public interface OrderRepository extends JpaRepository<Order, Long> {
|
||||
List<Order> findByCustomerIdAndCreatedAfter(Long customerId, Instant after);
|
||||
}
|
||||
```
|
||||
|
||||
### Configuration properties
|
||||
```java
|
||||
@ConfigurationProperties("payments")
|
||||
public record PaymentsConfig(String url, Duration timeout, String apiKey) {}
|
||||
```
|
||||
|
||||
```yaml
|
||||
# application.yml
|
||||
payments:
|
||||
url: https://api.stripe.com
|
||||
timeout: 5s
|
||||
api-key: ${STRIPE_KEY}
|
||||
```
|
||||
|
||||
### Virtual threads (Boot 3.2+, Java 21)
|
||||
```yaml
|
||||
spring:
|
||||
threads:
|
||||
virtual:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
### WebFlux reactive endpoint
|
||||
```java
|
||||
@GetMapping("/stream")
|
||||
public Flux<Event> stream() {
|
||||
return eventRepo.findAll().delayElements(Duration.ofMillis(100));
|
||||
}
|
||||
```
|
||||
|
||||
### Test (slice)
|
||||
```java
|
||||
@WebMvcTest(OrderController.class)
|
||||
class OrderControllerTest {
|
||||
@Autowired MockMvc mvc;
|
||||
@MockBean OrderService service;
|
||||
|
||||
@Test
|
||||
void createsOrder() throws Exception {
|
||||
when(service.place(any())).thenReturn(new Order(1L, "sku", 100));
|
||||
mvc.perform(post("/orders").contentType(APPLICATION_JSON)
|
||||
.content("""{"sku":"sku","amount":100}"""))
|
||||
.andExpect(status().isCreated());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Java enterprise backend | Spring Boot |
|
||||
| 매 reactive, high-concurrency I/O | WebFlux + R2DBC |
|
||||
| 매 traditional blocking I/O + Java 21 | Spring MVC + virtual threads |
|
||||
| Native binary (cold start, low memory) | Spring Boot AOT + GraalVM |
|
||||
| Lightweight Java (no DI ecosystem) | Quarkus / Micronaut / pure Javalin |
|
||||
|
||||
**기본값**: Spring Boot 3.4 + Java 21 + virtual threads + Spring MVC.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Inversion of Control]]
|
||||
- 변형: [[Spring Boot]]
|
||||
- 응용: [[Microservices]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: Java backend, 매 enterprise integration (JPA, security, messaging) 필요.
|
||||
**언제 X**: 매 ultra-low memory (serverless cold start) — Quarkus native 의 superior; 매 non-Java stack.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Field injection (`@Autowired` private field)**: 매 testability X, 매 final X. Constructor 의 사용.
|
||||
- **God `@Configuration`**: 매 100+ bean 의 한 file — 매 module 별 분리.
|
||||
- **`@Transactional` on private**: 매 proxy 의 work X. Public + self-injection 패턴.
|
||||
- **Boot 1.x / Java 8**: 매 EOL, 매 vulnerable, 매 upgrade.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (spring.io docs, Spring Boot 3.4 release notes 2025).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — Spring Boot 3.4 / Java 21 modern patterns |
|
||||
Reference in New Issue
Block a user