How sugurutakahashi-1234/framework-independent-architecture works
Project type and purpose
• This is an iOS sample app (SwiftUI) demonstrating a Framework-Independent Architecture (FIA)—a Clean-Architecture-inspired, multi-module, multi-project setup using Swift Package Manager (SPM) and Xcode workspaces.
• Purpose: Show how to split the code into Presentation, Domain, Framework, and Dependency-Injection layers, with separate Xcode projects for development (using mocks) and production (using real drivers) to speed up build times.
File structure
• Top-level:
• FIASample.xcworkspace
• Two Xcode projects under FIASample/Development and FIASample/Production (each containing its own App target, asset catalogs, tests).
• FIASamplePackage (an SPM package) with four modules under Sources:
– DependencyInjectionLayer
– PresentationLayer
– DomainLayer
– FrameworkLayer
• Tests under FIASamplePackage/Tests for unit testing.
• Configuration files: Package.swift (defines inter-module dependencies), Xcode project files, .gitignore.
Additional insights from README
• There are two entry points: DevelopmentApp (injects MockDIContainer) and ProductionApp (injects DIContainer with real FrameworkLayer.LicenseDriver).
• Dependency graph (from README):
• DependencyInjectionLayer → {FrameworkLayer, PresentationLayer}
• PresentationLayer → DomainLayer
• FrameworkLayer → DomainLayer & LicensesPlugin
• Clean Area extends from Presentation through Application Layer; FrameworkLayer is Non-Clean Area.
Elements
• Clear labels: “DomainLayer,” “PresentationLayer,” “DependencyInjectionLayer,” “FrameworkLayer,” “DevelopmentApp,” “ProductionApp,” “LicensesPlugin.”
• PresentationLayer → DomainLayer
• FrameworkLayer → DomainLayer
• DependencyInjectionLayer → {PresentationLayer, FrameworkLayer}
• App → DependencyInjectionLayer
• FrameworkLayer → LicensesPlugin
• Another for “DI/Application” (DependencyInjectionLayer, App targets)
• A third for “Non-Clean Area” (FrameworkLayer, external plugin)