July 2023
Intermediate to advanced
276 pages
6h 55m
English
ARM was a good step in the right direction, but it’s not very effective—never trust anything with the word management in it, right? Just kidding. Anyone using our class has to figure out that it implements AutoCloseable and remember to use the try-with-resources construct. It’d be great if the API we design could guide the programmers and, with the compiler’s help, point them in the right direction. We can easily achieve that with lambda expressions and the execute around method (EAM) pattern.
EAM is a powerful pattern that makes use of lambda expressions to wrap a piece of code. As the name alludes to, we can design to perform a pre-op and a post-op around the execution of the code. ...
Read now
Unlock full access