Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Namespace Structure and Module Organisation

All production code lives under the SimplEnteiner project. The table below maps namespaces to folders and summarizes their responsibility.

NamespaceFolderResponsibility
SimplEnteinerSimplEnteiner/ (root, TypeAnalyzes.cs, TypeAnalyzes.TypeCondition.cs)Standalone reflection/type-introspection toolkit (TypeAnalyzes static partial class, TypeCondition flags enum, CircularDependencyException). Usable independently of the DI container.
SimplEnteiner.AnalysisAnalysis/ReachabilityAnalyzer — BFS-based reachability computation over a dependency graph.
SimplEnteiner.CoreCore/DIContainer (public entry point), Delegates.cs (ResolverFunc), Constants.cs, BindExample.cs (internal usage examples, not part of the public API contract).
SimplEnteiner.Core.AttributesCore/Attributes/InjectAttribute, IdAttribute — mark constructors/members for injection and disambiguate conditional/id-based bindings.
SimplEnteiner.Core.BinderCore/Binder/BindingBuilder — mutable, staged binding descriptor.
SimplEnteiner.Core.Binder.BuilderStagesCore/Binder/BuilderStages/Stage, InitialStage, ImplementationStage, LifetimeStage, OptionsStage, FinalStage, BuilderStateMachine — internal staged validation engine (all internal).
SimplEnteiner.Core.Binder.InterfacesCore/Binder/Interfaces/Public fluent contracts: IBinder, IBindingTo(<T>), IBindingLifetime(<T>), IBindingOptions(<T>), IBindingDecorate(<T>), IBindingDecorateLifetime(<T>), and the internal IBindingTarget.
SimplEnteiner.Core.Binder.ImplementationsCore/Binder/Implementations/Internal concrete implementations of the interfaces above: BindingTo(<T>), BindingLifetime(<T>), BindingOptions(<T>), BindingDecorate(<T>), BindingDecorateLifetime(<T>).
SimplEnteiner.Core.RegistrationServiceCore/RegistrationService/IRegistry/Registry (registration storage & validation), Registration, DecoratorRegistration.
SimplEnteiner.Core.RegistrationService.FactoryCore/RegistrationService/Factory/IRegistryFactory/RegistryFactory — pluggable Registry creation strategy.
SimplEnteiner.Core.ResolverServiceCore/ResolverService/IResolver/Resolver — the resolution algorithm (constructor/member injection, generic wrappers, decorators, lifetime storage).
SimplEnteiner.Core.ScopeFeatureCore/ScopeFeature/IScope/Scope (hierarchical container), ScopeCreationConfig, ConditionalKey, ResolutionContext (internal per-resolve state).
SimplEnteiner.Core.ScopeFactoryCore/ScopeFactory/IScopeFactory/DefaultScopeFactory — pluggable child-Scope creation strategy.
SimplEnteiner.Core.LifecycleCore/Lifecycle/LifeTime enum, IInitializable, IAsyncInitializable, IStartable, internal ICleanupService/CleanupService, internal IInterfaceInvoker/InterfaceInvoker.
SimplEnteiner.Core.RepositoryServiceCore/RepositoryService/IRepositoryService/RepositoryService — dictionary-like store for singleton instances with disposal tracking, wrapping a Dictionary<Type,object> behind numerous collection interfaces.
SimplEnteiner.Core.ConventionBinding.InterfacesCore/ConventionBinding/Interfaces/IConventionBuilder — fluent contract for assembly-scanning based auto-registration.
SimplEnteiner.Core.ConventionBinding.ImplementationsCore/ConventionBinding/Implementations/ConventionBuilder, internal ConventionBindType flags enum.
SimplEnteiner.Core.InstallerService.InterfacesCore/InstallerService/Interfaces/IInstaller — a unit of registration logic that can be discovered and invoked via ScanAndInstall.
SimplEnteiner.Core.ConfigurationCore/Configuration/Internal serializable DTOs: ScopeConfig, BindingConfig, DecoratorConfig, used by the export/import feature.
SimplEnteiner.UtilitiesUtilities/Cross-cutting extension methods: ThrowExtensions (argument guarding), ListExtensions (binary-search insertion for decorator ordering), ContainerExtensions (ScanAndInstall).
SimplEnteiner.Integrations.MS_DIIntegrations/MS_DI/Extensions.AddSimplEnteiner, SimplEnteinerServiceProvider, SimplEnteinerServiceScope — Microsoft.Extensions.DependencyInjection adapter layer.

Visibility Conventions

  • Types that are part of the intended public extension surface (fluent binder interfaces, DIContainer, IScope, lifecycle interfaces, attributes, TypeAnalyzes) are public.
  • Types that are implementation details consumers should not depend on directly (Registry, Resolver, RepositoryService, CleanupService, InterfaceInvoker, all Binder.Implementations and Binder.BuilderStages classes) are marked internal.
  • A small number of types are public because they need to flow through public interface members even though direct construction by consumers is unusual: Registration, DecoratorRegistration, BindingBuilder, ConventionBuilder.

Test Project Structure

The SimplEnteinerTests project mirrors this structure with an xUnit test per feature area, plus a TestTypes/ folder containing purpose-built fixture types (interfaces, classes, structs, enums, attributes, delegates) used across many tests without polluting production code. See Testing and Quality Assurance for details.

Continue to Dependency Injection Integration.