docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
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 폴더 제거.
This commit is contained in:
@@ -0,0 +1,153 @@
|
||||
---
|
||||
id: wiki-2026-0508-vfunction
|
||||
title: vFunction
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [virtual function, 가상 함수, vFunction.com]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [oop, polymorphism, architecture, modernization]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: cpp
|
||||
framework: none
|
||||
---
|
||||
|
||||
# vFunction
|
||||
|
||||
## 매 한 줄
|
||||
> **"매 dispatch 의 runtime 의 resolve"**. 매 term 의 two meanings — (1) C++ `virtual` function (vtable-based dynamic dispatch), (2) vFunction.com (AI-driven Java monolith → microservices modernization platform). 매 context 의 disambiguate.
|
||||
|
||||
## 매 핵심
|
||||
|
||||
### 매 (1) Virtual function (C++)
|
||||
- **vtable**: 매 class per — function pointer table.
|
||||
- **vptr**: 매 instance per — vtable 의 pointer.
|
||||
- **Dispatch**: `obj->fn()` → `obj->vptr[fn_index]()` (one extra indirection).
|
||||
- **Cost**: ~1-2 ns per call, 매 inlining 의 block.
|
||||
- **Override**: derived class 의 same signature 의 redefine.
|
||||
|
||||
### 매 (2) vFunction.com platform
|
||||
- **Static + dynamic analysis**: 매 Java/.NET monolith 의 scan.
|
||||
- **Domain extraction**: AI 의 bounded context 의 cluster.
|
||||
- **Refactor recommendation**: 매 service boundary + dead code + TCO.
|
||||
- **2025 update**: Claude/GPT-5 backed reasoning, 매 Spring Boot extraction template.
|
||||
|
||||
### 매 응용 (vfunc C++)
|
||||
1. Strategy pattern.
|
||||
2. Plugin/driver interface.
|
||||
3. Mock injection 의 testing.
|
||||
|
||||
### 매 응용 (vFunction.com)
|
||||
1. Legacy Java EE → microservice migration.
|
||||
2. Technical debt quantification.
|
||||
3. Architectural drift detection.
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### Virtual function (modern C++20)
|
||||
```cpp
|
||||
struct Shape {
|
||||
virtual ~Shape() = default;
|
||||
virtual double area() const = 0; // pure virtual
|
||||
};
|
||||
|
||||
struct Circle : Shape {
|
||||
double r;
|
||||
explicit Circle(double r) : r(r) {}
|
||||
double area() const override { return 3.14159 * r * r; }
|
||||
};
|
||||
|
||||
double total(std::span<const std::unique_ptr<Shape>> shapes) {
|
||||
double s = 0;
|
||||
for (auto& sh : shapes) s += sh->area(); // dynamic dispatch
|
||||
return s;
|
||||
}
|
||||
```
|
||||
|
||||
### Devirtualization hint (final)
|
||||
```cpp
|
||||
struct FastCircle final : Shape { // final → compiler 의 devirtualize
|
||||
double area() const override final { return 3.14; }
|
||||
};
|
||||
```
|
||||
|
||||
### CRTP (static polymorphism, vfunc 의 X)
|
||||
```cpp
|
||||
template<class Derived>
|
||||
struct Shape {
|
||||
double area() const { return static_cast<const Derived*>(this)->area_impl(); }
|
||||
};
|
||||
|
||||
struct Square : Shape<Square> {
|
||||
double s;
|
||||
double area_impl() const { return s * s; } // zero overhead
|
||||
};
|
||||
```
|
||||
|
||||
### Rust (trait object, vfunc analog)
|
||||
```rust
|
||||
trait Shape { fn area(&self) -> f64; }
|
||||
struct Circle { r: f64 }
|
||||
impl Shape for Circle { fn area(&self) -> f64 { 3.14 * self.r * self.r } }
|
||||
|
||||
fn total(shapes: &[Box<dyn Shape>]) -> f64 {
|
||||
shapes.iter().map(|s| s.area()).sum() // dyn dispatch via vtable
|
||||
}
|
||||
```
|
||||
|
||||
### vFunction.com workflow (concept)
|
||||
```yaml
|
||||
# .vfunction/config.yaml
|
||||
target: java/spring-boot
|
||||
analyze:
|
||||
paths: [src/main/java]
|
||||
exclude: [test, generated]
|
||||
extract:
|
||||
strategy: domain-driven
|
||||
min-cohesion: 0.7
|
||||
recommendations:
|
||||
- service-boundaries
|
||||
- dead-code
|
||||
- dependency-cycles
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Runtime polymorphism, OOP | virtual function |
|
||||
| Hot loop, type known | CRTP / template |
|
||||
| Plugin boundary | virtual + dyn lib |
|
||||
| Legacy Java refactor | vFunction.com |
|
||||
| Greenfield modular | DDD + bounded context |
|
||||
|
||||
**기본값**: virtual function 의 default OOP, CRTP 의 perf-critical.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Object-Oriented-Programming]] · [[Polymorphism]]
|
||||
- Adjacent: [[Legacy Modernization]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: legacy code 의 virtual function chain 의 analyze, 매 modernization scope 의 estimate.
|
||||
**언제 X**: 매 micro-optimization decision (devirtualize 의 X) — 매 profiler 의 use.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Virtual everything**: 매 every method 의 virtual, 의 cost + 의 hard 의 reason. Final 의 default.
|
||||
- **Diamond inheritance**: 매 multiple virtual base, 의 composition 의 prefer.
|
||||
- **Virtual destructor 의 forget**: base class polymorphic, 의 leak.
|
||||
- **vFunction 의 silver bullet**: tool 의 recommendation 의 blindly 의 apply, 의 domain understanding 의 first.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (ISO C++ standard, Stroustrup "Tour of C++" 3rd, vfunction.com docs 2025).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — full vFunction (virtual + platform) entry |
|
||||
Reference in New Issue
Block a user