Clean-Swift / CleanStore

A sample iOS app built using the Clean Swift architecture. Clean Swift is Uncle Bob's Clean Architecture applied to iOS and Mac projects. CleanStore demonstrates Clean Swift by implementing the create order use case described by in Uncle Bob's talks.

Home Page:https://clean-swift.com/clean-swift-ios-architecture/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should the Configurator be singleton?

onmyway133 opened this issue · comments

commented

Like in https://github.com/Clean-Swift/CleanStore/blob/master/CleanStore/Scenes/ListOrders/ListOrdersConfigurator.swift

You said that "There should be only one configurator for each scene, and the connection setup code should run once and only once" (http://clean-swift.com/clean-swift-ios-architecture/)

Why not let it be instance? Just create it (or DI) and let it do the job?

commented

+1 for DI, but no singletons pls.. let's keep it clean ;)

commented

I wonder if we can build a DI mechanism into Clean Swift like this:
https://github.com/orakaro/Pure-Swift-Dependency-Injection