Conclusion
Summary
SimplEnteiner is a compact, dependency-light Dependency Injection container for .NET (netstandard2.1) that implements, from first principles, the full set of features expected of a mature IoC container:
- A fluent, staged, misuse-resistant binding API (Binder API).
- Hierarchical scopes with correct
Transient/Singleton/Scoped/Cachedlifetime semantics (Scopes, Lifetimes and Disposal). - Constructor, field, property, and method injection with attribute-based disambiguation (Attributes and Delegates).
- Decorators, including open-generic decorator support (Decorators).
- Convention-based/assembly-scanning registration and a lightweight installer/module system (Convention-Based Binding).
- Structural dependency-graph validation and reachability analysis, enabling fail-fast composition roots (Reachability Analysis and Validation).
- A reusable, independently valuable reflection toolkit (
TypeAnalyzes) with aggressive caching (TypeAnalyzesReflection Toolkit). - First-class interoperability with
Microsoft.Extensions.DependencyInjection(MS.DI Integration API). - An experimental JSON-based configuration export/import mechanism (Configuration Import/Export (Serialization)).
Its value proposition is embeddability and transparency: a small, fully-owned, dependency-light codebase (two NuGet packages, no third-party IoC dependency) that application and library authors can audit, extend, or fork with confidence, while still covering the vast majority of features found in larger, more established DI containers.
Known Gaps and Roadmap
The following gaps were identified while producing this documentation and are recommended as a roadmap for future work:
- NuGet packaging is not configured — no
PackageId/Version/Description/license metadata, nodotnet pack/publish pipeline. See Building and Deployment. - No CI/CD pipeline — no GitHub Actions workflow (or other CI system) currently builds, tests, or publishes this repository automatically. See Testing and Quality Assurance → CI/CD Integration.
- Test coverage gap for
Core.*namespaces — the current test suite exhaustively coversTypeAnalyzesbut has no dedicated tests forDIContainer,Scope,Resolver,Registry, decorators, or the MS.DI integration layer, despite fixture types already prepared for lifetime/disposal testing. See Testing and Quality Assurance. - No public extensibility point for custom
ScopeCreationConfigonDIContainer—ConfigureConfigisprivate, so swapping in a customIResolver/IRegistryFactory/IScopeFactory/IRepositoryServicecurrently requires bypassingDIContainerand usingScopedirectly. See Configuration and Settings. - Serialization round-trip fidelity is incomplete — non-instance, non-decorator registrations lose their factory delegate on import and will throw
NullReferenceExceptionif resolved afterward;OnActivation/OnReleasecallbacks are never serialized. See Configuration Import/Export (Serialization) → Important Caveats. - No logging integration — there is no
ILogger/Microsoft.Extensions.Logginghook anywhere; all diagnostics must be added by consumers viaOnActivation/OnRelease/lifecycle interfaces/decorators. See Error Handling and Logging. - No
BenchmarkDotNetproject or published performance numbers — performance characteristics in this book are derived from code inspection, not measurement. See Performance and Optimization. Func<T>wrapper resolution recompiles its expression tree on every resolution (unlike constructor factories, which are cached) — a plausible, low-risk optimization target. See Performance and Optimization → Known Bottlenecks.- No
CONTRIBUTING.md, license file, or issue/PR templates currently exist in the repository. See Contributing.
Additional Resources
- Repository (inferred from
book.toml): https://github.com/JunDmitry/SimplEnteiner README.md— the project's one-line description ("A small DI framework").- Source code entry points for further exploration:
SimplEnteiner/Core/DIContainer.cs— start here to trace any public API call end-to-end.SimplEnteiner/TypeAnalyzes.cs— the reflection toolkit, useful even outside the DI context.SimplEnteiner/Core/BindExample.cs— internal usage examples covering most of the fluent API surface in one file.SimplEnteinerTests/— the most authoritative, executable source of truth forTypeAnalyzesbehavior.
This concludes the SimplEnteiner documentation book. Return to the Introduction or browse the Architecture and API Reference sections for deeper detail on any specific area.