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 폴더 제거.
6.2 KiB
6.2 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-추상화-abstraction | 추상화(Abstraction) | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
추상화(Abstraction)
매 한 줄
"매 essential 의 의 keep, 매 incidental 의 의 hide". 매 complexity management 의 의 의 의 의 핵심 의 mechanism — 매 detail 의 의 selectively 의 의 의 reveal 의 의 conceptual model 의 의 의 expose. 매 SOLID 의 D (Dependency Inversion) 의 의 의 foundation.
매 핵심
매 Abstraction 의 의 의 forms
- Procedural — 매 function 의 의 의 의 의 step 의 hide.
- Data — 매 representation 의 의 의 의 hide (ADT).
- Control — 매 flow 의 의 의 hide (iterator, async).
- Type — 매 generic / parametric polymorphism.
- Interface — 매 contract 의 의 의 의 의 expose, impl 의 의 의 hide.
매 Levels of abstraction
- High — 매 business domain ("place order").
- Mid — 매 application logic ("validate cart").
- Low — 매 implementation ("HTTP POST").
- Hardware — 매 CPU instruction.
매 핵심 properties
- Information hiding (Parnas, 1972) — 매 client 의 의 의 의 implementation 의 의 의 X.
- Encapsulation — 매 state + behavior 의 의 의 의 bundle.
- Substitutability (LSP) — 매 abstraction 의 의 의 의 의 satisfy 의 implementation 의 의 의 의 swap 의 의 가능.
매 vs Encapsulation
- 매 Abstraction = 매 "what" — 매 의 logical model.
- 매 Encapsulation = 매 "how" — 매 mechanism (private, accessor).
💻 패턴
매 Procedural abstraction
def calculate_invoice_total(invoice: Invoice) -> Money:
subtotal = sum_line_items(invoice.lines)
discount = apply_discounts(subtotal, invoice.coupons)
tax = compute_tax(subtotal - discount, invoice.address)
return subtotal - discount + tax
매 Data abstraction (ADT)
from abc import ABC, abstractmethod
class Stack[T](ABC):
@abstractmethod
def push(self, item: T) -> None: ...
@abstractmethod
def pop(self) -> T: ...
@abstractmethod
def peek(self) -> T: ...
@abstractmethod
def is_empty(self) -> bool: ...
# 매 ArrayList 의 의 의 implementation, LinkedList 의 의 의 의 implementation — 매 swap 가능
매 Interface (contract)
interface PaymentGateway {
charge(userId: string, amount: Money): Promise<ChargeResult>;
refund(chargeId: string): Promise<RefundResult>;
}
class StripeGateway implements PaymentGateway { /* ... */ }
class AdyenGateway implements PaymentGateway { /* ... */ }
class FakeGateway implements PaymentGateway { /* test */ }
매 Dependency inversion
// 매 High-level 의 의 의 abstraction 의 의 의 의 의 depend, 매 low-level impl 의 의 의 X.
class OrderService {
private final PaymentGateway gateway; // 매 abstraction
public OrderService(PaymentGateway gw) { this.gateway = gw; }
}
매 Type abstraction (generic)
fn largest<T: PartialOrd>(list: &[T]) -> &T {
let mut largest = &list[0];
for item in list {
if item > largest { largest = item; }
}
largest
}
매 Control abstraction (iterator)
def first_match(items: Iterable[T], pred: Callable[[T], bool]) -> T | None:
for item in items:
if pred(item): return item
return None
# 매 list, generator, file, stream 의 의 모두 의 의 의 work
매 Leaky abstraction (Joel Spolsky)
# 매 Bad — 매 underlying TCP 의 의 의 의 의 leak
def send(msg):
try: socket.send(msg)
except ConnectionResetError: ... # 매 abstraction 의 의 의 의 의 break
# 매 Better — 매 wrap
class MessageBus:
def send(self, msg) -> SendResult:
try: self._socket.send(msg); return SendResult.OK
except: return SendResult.RETRY
매 Higher-Kinded abstraction
trait Functor[F[_]] {
def map[A, B](fa: F[A])(f: A => B): F[B]
}
// 매 List, Option, Future 의 의 모두 의 Functor — 매 abstraction 의 의 의 매 type constructor 의 의 over
매 결정 기준
| 상황 | Approach |
|---|---|
| 매 detail 의 의 의 client 의 의 의 의 X 의 의 needed | 매 hide via 매 interface |
| 매 multiple impl 의 의 의 expected | 매 abstract class / interface |
| 매 single use, single impl | 매 직접 — 매 premature abstraction 의 X |
| 매 stable detail | 매 leak 의 의 의 의 의 fine — 매 simplicity 의 win |
| 매 cross-process boundary | 매 strong abstraction (RPC, queue) |
기본값: 매 rule of three — 매 셋 의 의 의 의 의 occur 의 의 의 의 abstract.
🔗 Graph
- 변형: Encapsulation · Information Hiding · Polymorphism
- 응용: SOLID · Hexagonal Architecture · Clean Architecture
- Adjacent: TypeScript 타입 시스템 (TypeScript Type System)
🤖 LLM 활용
언제: 매 design — 매 boundary 의 의 의 draw, 매 변경 의 의 absorb 의 의 의 abstraction layer 의 의 의 introduce. 언제 X: 매 single-call site, 매 prototype — 매 premature abstraction 의 의 의 cost.
❌ 안티패턴
- Premature abstraction: 매 한 implementation 의 의 의 의 의 interface 의 의 introduce — 매 noise.
- Leaky abstraction: 매 underlying detail 의 의 의 의 surface — 매 client 의 의 의 의 know 의 의 force.
- God interface: 매 모든 의 method 의 의 의 의 한 interface 의 의 — ISP 의 violation.
- Wrong abstraction (Sandi Metz): 매 잘못 의 abstraction 의 의 의 duplication 의 의 보다 의 worse.
🧪 검증 / 중복
- Verified — Parnas (1972) "On the Criteria To Be Used in Decomposing Systems"; Joel Spolsky "Law of Leaky Abstractions"; Sandi Metz, Practical Object-Oriented Design.
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — abstraction forms + leaky / wrong-abstraction discussion |