Great video. Been struggling with testing for a while and you explained it very simply
@ryt-is
Жыл бұрын
Thank you. Glad it helped
@chipsmanml
Жыл бұрын
Sorry, but in this video you didn't "remove the mockito", you just got rid of the object oriented programming instead, now you can go further and remove the service at all by replacing it with a static method (which will even increase (theoretically) the performance)
@ryt-is
Жыл бұрын
Please elaborate on why you think object oriented programming was removed
@olivieryuki4489
3 ай бұрын
@@ryt-is I think what he meant is that you refactored calculateBalance method into a pure function, hence, theoretically, you could also make it static. Then the object balanceService holds no data (previously it held repositories, encapsulated inside it) and it sort of becomes an empty object, whose only purpose is to group some logic inside of it. Some guy on the internet put it in a nice way, he said that in functional programming we separate logic from data (the way you moved out repositories from the service). In OOP we have objects that hold some state and logic to mutate that state (the way you had it before the refactor)
Пікірлер