Absolutely bonkers! Love it and hate it at the same time. Thankfully, starting with Java21 and type-pattern matching visitors can be replaced with switch expressions. Additionally, if sealed classes/interfaces are used, it can offer a compile-time guarantee that all subtypes in the hierarchy have been properly taken care of. Unlike here, where visiting logic is placed in the registry and only breaks at run-time. And with NPE, of all things! Nonetheless, video offers a lot of neat tricks for functional and fluent APIs. I'll surely use them either for builders or custom assertion classes for AssertJ.
@ruixue69553 жыл бұрын
1:30 why Visitor Pattern 3:28 code demo 3:37 the Visitor Pattern has to visit some *graph* object
@andreidei Жыл бұрын
this talk should be entitled "insane people code like this"...
@justADeni9 ай бұрын
it got pretty good in the middle and then devolved again in the end
@badpotato2 жыл бұрын
this is Nice video. it is a different way of solving a problem
@kitkarson42263 жыл бұрын
Great presentation.
@leonidpiliptsevich53293 жыл бұрын
Awesome, thank you!
@TJ-hs1qm11 ай бұрын
9:06 vp violates the GOF rule to never depend on concrete types, only on abstractions. How do you inject MockBody for Body in a test if the code depends on concrete types?
@mihaiapostol78646 ай бұрын
use mockito
@hemanhy2 жыл бұрын
Very insightful Thank you!
@nithinvarghese4737 Жыл бұрын
Great Video Learned a lot and a lot of tricks are now in my sleeve !! . Thank you soo much 34:52 In the Interface X, How can one call define method type() as an instance value out of it , Can anyone share info or notes on the same?
@kitkarson4226 Жыл бұрын
check at 33:44 - type() is a method in the interface X
@yadigarcaliskan64533 жыл бұрын
Great thank you!
@an2ber Жыл бұрын
i hope nobody writes this kind of code in production
@kitkarson4226 Жыл бұрын
It is about learning various tricks. You do not have to write like this. sometimes, to teach, we have to use things like this.