Very interesting. First time I’ve heard of it. Normally if I have repetitive code I create an extension of a particular class. This looks so much better. Perhaps I’ll try to incorporate this into my apps. Incidentally, when my simulator stops working. I just quit the app and it gets fixed. For me erasing it means that I would have to log back in.
Are there any cons about making all those factory functions static? In this case you don't need to inject this Factory object into each view controller, and you can use it just like this - ScreenFactory.makeLoginScreen(params: SomeParams)
Its better not not have any mistakes so that the person coding along with you doesn’t get told the wrong information while they are learning.
Very interesting. First time I’ve heard of it. Normally if I have repetitive code I create an extension of a particular class. This looks so much better. Perhaps I’ll try to incorporate this into my apps. Incidentally, when my simulator stops working. I just quit the app and it gets fixed. For me erasing it means that I would have to log back in.
Nice
We use this pattern + coordinators where I work at
Nice
Can you give us some examples of what you use factories for in real apps.
Thanks for the explanation! It's the factory the same as a mapper then?
They are similar
Can this Designer Pattern be used in projects with any architecture (VIPER, MVC, MVVM)?
Конечно, можно. Одно другому не мешает
Yes, absolutely
All architectures are made up of various design patterns. you can use any you'd like they simply may not be best for the job.
is this design pattern same with builder pattern? Or they are something different?
I'm waiting for Clean Architecture implementation in iOS (UIKit/Swift).
Very soon!
cool
Thx
Are there any cons about making all those factory functions static? In this case you don't need to inject this Factory object into each view controller, and you can use it just like this - ScreenFactory.makeLoginScreen(params: SomeParams)
Static is generally harder to test and has a memory impact. Instance APIs are preferred though its subjective to a degree