Skip to main content

Overview

Main building blocks

  • TInject: public API (register/get/remove, logging, cache, cycle detection).
  • TInjectContainer: base class with dictionaries and factory.
  • TInjectFactory: builds service metadata (TServiceData).
  • TServiceData: stores lifetime and creates instances via RTTI.
  • TInjectEvents: lifecycle hooks and constructor param provider.

Practical rules

  • Register services during bootstrap (before multiple threads start resolving).
  • For auto-inject, keep constructors simple and dependencies registered upfront.