Very good explanation on protocols but I wouldn't watch the whole video, the zoom-in and out drove me crazy, sorry but I like to see the whole code as much as possible. Thanks.
For those who mention that this is not DI, in Swift, we have two basic types of DI: Initializer Injection and property injection. Since Swift is Protocol Oriented Programming (POP!) language you can use protocols as a type, in this video he is using basically Initializer injection. And remember one of the goals of DI is to help to create code loosely coupling and he is accomplishing that. IMHO
@@bobs6473 This can only be DI if he was receving the Email, Yahoo and Outlook dependencies from outside. But I see that he's creating those objects within the class. (he's relying on concretion instead of abstraction),
This isn't Dependency Injection, this is Dependency Inversion. There is a subtle (edit: fixing spelling typo) nuance between the two. This is still well worth knowing and understanding : Source: Me and my PhD Advisor who literally wrote one of the books on the topic ;) if you want to understand the distinction, this is Inversion of Dependencies from the S.O.L.I.D. Principles (the I one). This is 100% worth knowing, but the Poster (and possibly the ios community are conflating different terms), Also Note: Dependency Inversion is also called Inversion of Control (clearer naming)
I truly appreciate your contents but coming from Android world, this for me is Inversion of Control or the "I" in SOLID principle, here's how Wikipedia defines IoC - "In software engineering, inversion of control (IoC) is a design pattern in which custom-written portions of a computer program receive the flow of control from a generic framework. A software architecture with this design inverts control as compared to traditional procedural programming: in traditional programming, the custom code that expresses the purpose of the program calls into reusable libraries to take care of generic tasks, but with inversion of control, it is the framework that calls into the custom, or task-specific, code."
@@iOSAcademy I wish there was a mutual convention of how concepts are named. 10 languages, 11 names for the same thing... I learned to call dependency injection "aggregation of objects that implement a common interface"...
Very good explanation on protocols but I wouldn't watch the whole video, the zoom-in and out drove me crazy, sorry but I like to see the whole code as much as possible. Thanks.
For those who mention that this is not DI, in Swift, we have two basic types of DI: Initializer Injection and property injection.
Since Swift is Protocol Oriented Programming (POP!) language you can use protocols as a type, in this video he is using basically Initializer injection.
And remember one of the goals of DI is to help to create code loosely coupling and he is accomplishing that. IMHO
still this is not get near what di is
@@bobs6473 This can only be DI if he was receving the Email, Yahoo and Outlook dependencies from outside. But I see that he's creating those objects within the class. (he's relying on concretion instead of abstraction),
This isn't Dependency Injection, this is Dependency Inversion. There is a subtle (edit: fixing spelling typo) nuance between the two. This is still well worth knowing and understanding : Source: Me and my PhD Advisor who literally wrote one of the books on the topic ;) if you want to understand the distinction, this is Inversion of Dependencies from the S.O.L.I.D. Principles (the I one). This is 100% worth knowing, but the Poster (and possibly the ios community are conflating different terms), Also Note: Dependency Inversion is also called Inversion of Control (clearer naming)
Yes, just a small correction. The 'I' is for "Interface segregation principle", the "D" is for dependency inversion.
Thank you , in addition It was good to know how to deal with error messages step by step to see what part of code explodes app
youre welcome!
I truly appreciate your contents but coming from Android world, this for me is Inversion of Control or the "I" in SOLID principle, here's how Wikipedia defines IoC - "In software engineering, inversion of control (IoC) is a design pattern in which custom-written portions of a computer program receive the flow of control from a generic framework. A software architecture with this design inverts control as compared to traditional procedural programming: in traditional programming, the custom code that expresses the purpose of the program calls into reusable libraries to take care of generic tasks, but with inversion of control, it is the framework that calls into the custom, or task-specific, code."
Protocols are like Interfaces in Java, aren't they?
Yes
@@iOSAcademy I wish there was a mutual convention of how concepts are named. 10 languages, 11 names for the same thing... I learned to call dependency injection "aggregation of objects that implement a common interface"...
👍
Thanks
zoom gave me a headache
I think it's not Dependency Injection concept...
This is Is polymorphism
No it's not. Protocols ARE not parent classes.
This is not DI
Really Nice Man... Thanks
Youre welcome!
This is not Dependency Injection!
Check out the updated video
Awful presentation. Thx
Sorry to hear it, Ive got a related follow vid coming soon
Are you serious?