9148c358d0
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
5.7 KiB
5.7 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-object-seam-객체-접점 | Object Seam (객체 접점) | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
Object Seam (객체 접점)
매 한 줄
"매 OO 언어에서 다른 코드 변경 없이 동작을 바꿀 수 있는 분기점 — 매 polymorphism이 enabling point.". Michael Feathers의 Working Effectively with Legacy Code (2004) 에서 정의된 3개 seam (preprocessing, link, object) 중 가장 강력. 2026 현재 mock framework · DI container의 핵심 메커니즘.
매 핵심
매 3 seam types
- Preprocessing seam: C/C++ macro 치환 — enabling point는 build flag.
- Link seam: linker가 symbol을 binding — enabling point는 link order.
- Object seam: virtual dispatch — enabling point는 object instantiation.
매 Object Seam 작동 원리
- Polymorphic type (interface, abstract class, base class with virtual)
- Caller가 abstract type 사용
- Subtype 선택은 외부 (constructor, factory, DI container)
- 매 단순 if/else 분기 vs polymorphism 분기
매 응용
- Test에서 real DB → in-memory fake 교체.
- HTTP client → mock으로 network 차단.
- Strategy pattern으로 algorithm swap.
💻 패턴
Java — interface seam
public interface PaymentGateway {
PaymentResult charge(Money amount, Card card);
}
public class CheckoutService {
private final PaymentGateway gateway; // ← seam
public CheckoutService(PaymentGateway g) { this.gateway = g; }
public Order checkout(Cart cart, Card card) {
var result = gateway.charge(cart.total(), card);
return result.success() ? Order.confirmed(cart) : Order.failed();
}
}
// Test: enabling point = constructor arg
@Test void rejects_failed_payment() {
var fake = (amount, card) -> PaymentResult.failed("declined");
var svc = new CheckoutService(fake);
assertEquals(OrderStatus.FAILED, svc.checkout(cart, card).status());
}
TypeScript — class hierarchy seam
abstract class Notifier {
abstract send(msg: string): Promise<void>;
}
class EmailNotifier extends Notifier { /* SMTP */ }
class TestNotifier extends Notifier {
sent: string[] = [];
async send(msg: string) { this.sent.push(msg); }
}
// Production: new EmailNotifier()
// Test: new TestNotifier() — same caller
C++ — virtual function seam
class Clock {
public:
virtual ~Clock() = default;
virtual std::chrono::system_clock::time_point now() const = 0;
};
class SystemClock : public Clock {
auto now() const override { return std::chrono::system_clock::now(); }
};
class FakeClock : public Clock {
std::chrono::system_clock::time_point t_;
public:
void advance(std::chrono::seconds s) { t_ += s; }
auto now() const override { return t_; }
};
Introducing seam to legacy code (Extract Interface)
// Before: hard dependency on concrete class
public class Report {
public void generate() {
var db = new MySQLConnection(); // ← no seam
// ...
}
}
// After: introduced object seam
public class Report {
private final Database db;
public Report(Database db) { this.db = db; }
public void generate() { /* uses db */ }
}
public interface Database { ResultSet query(String sql); }
public class MySQLConnection implements Database { /* ... */ }
Testing legacy code with subclass-and-override
public class LegacyService {
public Report run() {
var data = fetchData(); // ← protected, override in test
return process(data);
}
protected Data fetchData() { /* real network */ }
}
// Test
class TestableService extends LegacyService {
@Override protected Data fetchData() { return Data.fixture(); }
}
매 결정 기준
| 상황 | Approach |
|---|---|
| New code, OO language | Constructor injection + interface |
| Legacy class, can't refactor much | Extract Interface + DI |
| Sealed legacy class | Subclass and Override Method |
| C/C++ no virtual overhead | Link seam (selective compilation) |
| Functional language | Higher-order function = seam |
기본값: interface + constructor injection — 매 가장 explicit · testable.
🔗 Graph
- 부모: Seam (접점) · Seams (이음새)
- 변형: Link Seam (링크 접점) · Preprocessing Seam (전처리 접점)
- 응용: Dependency Injection (의존성 주입) · Mock Objects (가짜 객체) · Test Doubles (테스트 대역)
- Adjacent: Polymorphism (다형성) · Hexagonal_Architecture_Ports_and_Adapters
🤖 LLM 활용
언제: legacy code testability 도입, mock framework 설계, plug-in architecture, strategy swap. 언제 X: pure functional code (no objects), one-shot script, performance-critical hot loop (virtual call overhead).
❌ 안티패턴
- Concrete class 직접 new: 매 seam 없음 — Test 어려움.
staticmethod 의존: 매 polymorphism 불가 — wrap with instance method.- Final/sealed class without interface: 매 subclass override seam도 막음.
- Service Locator (anti): 매 hidden dependency — explicit constructor injection 권장.
🧪 검증 / 중복
- Verified (Feathers WELC 2004, Fowler Refactoring 2nd ed., Meszaros xUnit Patterns 2007).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — Object seam definition + 3 language patterns |