younotesunreadstarredadd url

Using the factory pattern to avoid shared state in Swift — Swift by Sundell

https://www.swiftbysundell.com/posts/using-the-factory-pattern-to-avoid-shared-state-in-swift

september 2017IFTTT Pocketopen in karakeep

Swift by Sundell ‧ saved copy from 2026.03.02

Karakeep has no AI summary for this page yet. summarize now

page description:

Shared state is a really common source of bugs in most apps. It’s what happens when you (accidentally or by design) have multiple parts of a system that rely on the same mutable state. This week, let’s take a look at how shared state can be avoided in many situations, by using the factory pattern to create clearly separated instances that each manage their own state.
screenshot of the page

« back to bookmarks