~/talk

Breaking Dependencies: Type Erasure - A Design Analysis

Talkat CppCon 2021 · on Thursday, 2021-10-28· at 07:45· online· [rust]
slides:none on file

Claims that replacing inheritance with type erasure significantly reduces coupling and simplifies maintenance by extracting operations from domain types into a value wrapper that erases concrete types at runtime. Implementation uses a templated constructor, an internal model/base pair and a clone method (prototype) to provide value semantics, combining external polymorphism with the classic bridge and prototype patterns. The concrete build is a Shape wrapper that stores circles/squares without pointers in user code, works at runtime, and has libraries (boost type_erasure dyno zoo) and SBO strategies to regain performance.

AI-written summary · about

  1. 0:00Introduction
  2. 2:10Design and dependencies challenge
  3. 4:59Naive inheritance problems
  4. 9:32Strategy design pattern
  5. 23:28Strategy pattern limitations
  6. 26:58What type erasure is
  7. 31:58External polymorphism
  8. 37:19Bridge and prototype patterns
  9. 42:13Type erasure with shapes
  10. 50:28Benefits and trade-offs
  11. 56:26Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.