Why not everything is created in assemblies? For example UINavigationController.
Jasper Blues
@jasperblues
Why are some classes defined in Typhoon and some not?
Roman Temchenko
@iThinker
I am sorry. I did not get your sarcasm.
Jasper Blues
@jasperblues
no, i want you to clarify you question.
Roman Temchenko
@iThinker
Then I did not get your question. There is a RootController. It can show other controllers. But instead of asking assembly for UINavigationController, it takes UIViewController and wraps it into UINavigationController. I thought in case of DI, UINavigationController should be created by factory with proper root view controller.
Jasper Blues
@jasperblues
My question was asking you to clarify your question.
Is that clear?
I understand your question now.
The idea is to define the key actors in your assembly. Arguably that could be a UIViewController defined in the assembly. You can try that modification if you like.
Roman Temchenko
@iThinker
Ok. I see. Thank you. One last quick question. How to create object using its factory method. (In Cocoa it is called Class Cluster, in other languages it is Abstract Factory I believe)
Jasper Blues
@jasperblues
Yes, that’s right.
Roman Temchenko
@iThinker
That was a question. How to do it?
Jasper Blues
@jasperblues
Yes, that’s right . . . class cluster is related to abstract factory. If you want to do this with Typhoon you can:
Looks like it is not what I wanted. I have [Class instanceForCustomer], [Class instanceForContractor]. And I wanted factory to return those instances. But with additional injection.
So I should either move all configuration to Assembly. Or don't use Assembly at all for it.
I've found.
Jasper Blues
@jasperblues
I see. . If you want it factory method to be on the class, you can have the class method use Typhoon. This would have to be a separate factory.