Exploring Factory Macros

Dependency injection without the ceremony

Exploring Factory Macros

Dependency injection without the ceremony

Michael Long
Michael Long
  ∙  
May 13, 2026
  ∙  
12 min read
Member-only content
  ∙  
View on Medium
Factory name and logo copyright Michael Long

Factory name and logo copyright Michael Long

Swift dependency injection has always had an annoying habit of making the boring part visible.

Not the dependency graph. Not the architecture. Not the contract between a type and the services it needs. But the plumbing.

From Swinject on, almost every dependency injection mechanism I’ve ever used has felt… clunky.

And that’s one of the reasons why created Factory.

Factory’s original annotation-style property wrappers (@Injected) made dependency injection lookups compact, readable, and testable. And compared to hand-wiring initializers across a large Swift or SwiftUI application, it was a huge improvement.

But Swift’s moved on.

Structured Concurrency

Over the years, strict concurrency has…

Continue reading
This is a member-only story and can only be read on Medium.
Become a Medium member
Sent to sikubaycom.s3cr3tz@blogger.com by Michael Long on Medium
Unsubscribe from this writer's email notifications
Manage your email settings

3500 South DuPont Highway, Suite IQ-101, Dover, DE 19901
Careers·Help Center·Privacy Policy·Terms of service