Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 25 16:00
    ingemarson opened #606
  • Jul 25 03:45
    timur-st94 closed #605
  • Jul 25 03:45
    timur-st94 commented #605
  • Jul 16 09:48
    alexgarbarev commented #605
  • Jul 16 09:22
    timur-st94 opened #605
  • Jul 02 19:37

    alexgarbarev on master

    Travis config has been updated … (compare)

  • Jul 02 19:32
    alexgarbarev commented #603
  • Jul 02 19:22
    alexgarbarev commented #601
  • Jul 02 19:14

    alexgarbarev on master

    Example project migrated to Swi… Variable replaced to dynamic va… Merge pull request #604 from kb… (compare)

  • Jul 02 19:14
    alexgarbarev closed #604
  • Jul 02 19:14
    alexgarbarev commented #604
  • Jun 28 11:24
    kbakacak opened #604
  • Jun 26 03:45
    yalamandarao edited #603
  • Jun 25 10:51
    yalamandarao edited #603
  • Jun 25 10:23
    yalamandarao commented #578
  • Jun 25 10:23
    yalamandarao commented #578
  • Jun 25 10:22
    yalamandarao commented #578
  • Jun 22 04:38
    yalamandarao opened #603
  • May 30 18:38
    nicoabie commented #551
  • May 30 18:06
    nicoabie commented #551
Jasper Blues
@jasperblues
So the approach to DI will need to be different.
A solution based on the ObjC runtime seems to impose limitations
Jasper Blues
@jasperblues
I’ll discuss with other devs before we make an official recommendation.
Roman Temchenko
@iThinker
Hi guys. If I want to make some factory methods that return same object class but with different configurations, will I be able to do it
?
What will happen in such case?
Jasper Blues
@jasperblues
you mean methods on TyphoonAssembly?
Roman Temchenko
@iThinker
Yes.
Jasper Blues
@jasperblues
Yeah, this is no problem with Typhoon.
Roman Temchenko
@iThinker
  • (Class)object; - (Class)object1;
Jasper Blues
@jasperblues
One of the reasons for creating Typhoon was that other DI containers struggle with this.
Roman Temchenko
@iThinker
How will it resolve dependencies if then I instantiate [Class new] somewhere in code?
Jasper Blues
@jasperblues
Typhoon is a DI container so you should obtain your built instance from Typhoon. . . via the assembly interface.
Take a look at the Quick Start for example.
Roman Temchenko
@iThinker
Oh. Do you mean that having [Class new] objects fully configured is a side effect?
Yeah. I've seen it.
And I've looked at some 3rd paty videos.
I am just not familiar with DI
Jasper Blues
@jasperblues
No. Typhoon won’t touch you class unless you ask for it from Typhoon.
Roman Temchenko
@iThinker
YOu know, we don't have it usually in iOS .:D
Jasper Blues
@jasperblues
DI is a common design pattern. And it applies in all OO languages. . . (though some, eg Ruby, tend not to use/need a library to manage it).
Once you understand DI you’ll have another tool for solving problems.
You don’t necessarily need a library to do DI <—— If you can understand how it works https://github.com/appsquickly/Typhoon-example
Roman Temchenko
@iThinker
Well, I've done only iOS. And I've heard previously about DI. But i've not seen it on any project.
I understand what you mean.
Jasper Blues
@jasperblues
https://github.com/appsquickly/Typhoon-example <—— Here’s an example for you
Roman Temchenko
@iThinker
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:
  • Create a custom factory backed by Typhoon. (Inject the whole assembly into you custom factory, and then use it to emit the correct object).
clear?
Roman Temchenko
@iThinker
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.
Roman Temchenko
@iThinker
It is Factory Definitions section I think.
Jasper Blues
@jasperblues
Your class method would look something like: