I find the Liskov Substitution example disturbing. You could have just overridden the area() of the square like you did with the width and height and it would have worked as well without use of the protocol. This still doesn't mean the square is a substitute for rectangle.
I am ashamed that I only found out this video just now and not years ago. But I have a question that seems dumb but maybe anyone out there can help me with this. It explains that the service protocol and the object that implements it will be responsible for fetching data from the network or wherever it is. But for me, there's one missing thing where after the network request is done, it will have to update the UI. How to do that?
You observe the relevant data that will update the view. which is the job of your view controller.. So that everytime when something happens in the service that will have an impact in the view, view will be updated accordingly.
hairui lin well that is pretty obvious. But which class is responsible for notifying the viewcontroller that it needs to update it’s view because there are new data? Should I declare the view controller inside the service then? It will create a tight coupling right? An adapter? And because everything happens on the background, the only way I can think of, to notify the view controller is by checking from appdelegate’s UIWindow if the view controller is on top of the view controllers stack.
@@tityseptiani8584 There are several ways.. First, you can define a delegate in your service class, and make the viewcontroller the delegate.. listen to the change.. second, if your service is class, make your property dynamic, use KVO to observe the change in viewController... last but not list, you can make your service class a struct.. and everytime it mutates, get a difference between the mutating.. This is all done in view controller...
Finally a more professional tutorial, this one of the best programming video’s I’ve seen so far. Keep up the good work!
Thank you 🙏🏼
I just wanna say thank you for this video! I’ve watched it a couple times to drive home solid principles. I appreciate it!
Maybe you have a typo: area of square is side*side not side*2 😇 on 27:08
You are wrong and stupid. Its a 2D shape, not a 3D one
3D shape is side cubed. 2D shape is side squared, not side * 2. You are wrong and stupid.
check you're math and get back to me, idiot
what's wrong with my maths?
I found this silly argument 2 years later.
Hey Harlan, great talk and very helpful. Are the code examples/project available to download? Would be very useful to have. Thanks.
A very well prepared, clear and informative tutorial. Thank you
Great tutorial, very helpful. Thanks you.
ps. typo in square area 27:08
Beautiful lecture, I learned a lot, thanks for the upload.
Spotted a small error, the area of a square with side 3 is 9, not 6.
You missed the last one, Dependency Inversion!!!!!!
Very good explanation !
Nice !
Thanks for this great videos !
I find the Liskov Substitution example disturbing. You could have just overridden the area() of the square like you did with the width and height and it would have worked as well without use of the protocol. This still doesn't mean the square is a substitute for rectangle.
I am ashamed that I only found out this video just now and not years ago. But I have a question that seems dumb but maybe anyone out there can help me with this. It explains that the service protocol and the object that implements it will be responsible for fetching data from the network or wherever it is. But for me, there's one missing thing where after the network request is done, it will have to update the UI. How to do that?
You observe the relevant data that will update the view. which is the job of your view controller.. So that everytime when something happens in the service that will have an impact in the view, view will be updated accordingly.
hairui lin well that is pretty obvious. But which class is responsible for notifying the viewcontroller that it needs to update it’s view because there are new data? Should I declare the view controller inside the service then? It will create a tight coupling right? An adapter? And because everything happens on the background, the only way I can think of, to notify the view controller is by checking from appdelegate’s UIWindow if the view controller is on top of the view controllers stack.
@@tityseptiani8584 There are several ways.. First, you can define a delegate in your service class, and make the viewcontroller the delegate.. listen to the change.. second, if your service is class, make your property dynamic, use KVO to observe the change in viewController... last but not list, you can make your service class a struct.. and everytime it mutates, get a difference between the mutating.. This is all done in view controller...
Grateful!
Very informative. Code please :)
Helpfull!