How hmlongco/factory works
Main Components
a. Core Components:
• Container System
• Factory Registration System
• Dependency Resolution System
• Scope Management System
• Context Management System
• Property Wrapper System
b. Supporting Components:
• Debugging Infrastructure
• Testing Support
• SwiftUI Integration
• Concurrency Support
┌─────────────────────────────────────────────────────────┐
• Client Application │
• ┬─────────────────────────┬───────────────┘
┌───────────────▼─────┐ ┌──────────▼──────────┐
• Property Wrappers │ │ Direct Resolution │
• @Injected │ │ Container.shared │
• @LazyInjected │ └──────────┬──────────┘
• @InjectedObject │ │
• ┬───────────┘ │
┌─────────▼──────────────────────────────▼───────────────┐
• Factory Core │
• ┬───────────────────────────────┤
• Registration │ Resolution │
• ┌─────────────────┐ │ ┌────────────────────────┐ │
• Factory Definition│ │ │ Dependency Graph │ │
• Scope Management │ │ │ Instance Creation │ │
• Context Handling │ │ │ Scope Resolution │ │
• ┘ │ └────────────────────────┘ │
• ┘
• ┌──────────▼──────────┐
• Scope System │
• ┌────────────────┐ │
• Singleton │ │
• Cached │ │
• Shared │ │
• Unique │ │
• ┘ │
• ┘
• ┌──────────▼──────────┐
• Context System │
• ┌────────────────┐ │
• Debug │ │
• Preview │ │
• Test │ │
• Simulator │ │
• ┘ │
• ┘
Additional Elements
Callouts for:
• Concurrency support
• Debug tracing capabilities
• Testing integration points
• SwiftUI preview support
• Module separation capabilities
Implementation Details
• The container-based architecture
• The factory pattern implementation
• The property wrapper system
• The scope management system
• The context-aware resolution system