Looks like promising way to do DI in swift. If you think you really need a framework anyways. 🤷🏻♂️
This very brief and somewhat vague article makes the case that DI in Swift can be simple and doesn’t need a third-party dependency.
Dependency Injection seems so confusing and counterintuitive at first, so I love this quote which pretty well summarizes and demystifies it.
Dependency injection means giving an object its instance variables. Really. That’s it.Dependency Injection Demystified
This is a good real-life example of using of the Builder pattern. and a great way to make a URLRequest in Swift.
Benjamin Sandofsky, a Software Engineer in San Francisco, California.
— Read on sandofsky.com/blog/manager-classes.html
A technical pet peeve of mine, this post does a nice job articulating why “manager” classes in software design can be a problem. To me, a “manager” class is like saying, “this class does some stuff” and the stuff has no boundary. But what does this class do? What is it’s purpose? It might be a sign of an unfocused and unsustainable design.
Or as the post says:
Managers can be a symptom of poorly-defined responsibilities. When you think about it, the word “Manager” means nothing. In object oriented programming, every class is a manager. Cocoa Touch could have
UIViewManager, and even a humble