Manuel Meyer
1 min readAug 19, 2022

--

your store is anything but.

your web service singleton violates SOLID — especially S&D. This will also have impact on the validity of your testing.

Many seasoned architects — including "Uncle Bob" (Robert C. Martin) and my university professor — teach, that an architecture needs to be independent to the UI layer; it cannot know anything about this. Martin describes this as "UI must be an I/O device".

There-for the premise of doing MVVM in SwiftUI is already a step in the wrong direction.

And indeed I have not seen a MVVM implementation that actually meet this minimum threshold to actually be an architecture. same goes for all VIP and VIPER implementation for iOS I have come across.

that said I'd like to point to my article about "Khipu", a true architecture based on Martin's Clean Architecture. it is fully declarative, fully and easily testable: https://decodemeester.medium.com/khipu-rapid-and-sustainable-software-creation-in-swift-using-engineering-and-science-principles-312a933cce57?sk=8359f48cc06571e53de156db8cbc005c

The main characteristic of an architecture being independent from UI is demonstatrted in this radio app, which is loaded with different UI to perform certain experiments (PetriDish*):

https://gitlab.com/vikingosegundo/berts-radios

I'd be happy to receive your's and your readers' feedback on my writings and codes.

--

--

Manuel Meyer
Manuel Meyer

Written by Manuel Meyer

Freelance Software Developer and Code Strategist.

Responses (1)