4 ms·
> the asynchrone nature forces you to have abstract classes everywhere Could you elaborate?
by robmcm 11y ago
> the asynchrone nature forces you to have abstract classes everywhere
Could you elaborate?
- benmccann 11y agoAsynchronous code is often more performant, but requires you to supply a callback if you want to take further action after the async code completes. In Java, this typically means subclassing Callable or some other class and you end up with lots of anonymous subclasses, which can be quite verbose. Java 8 introduced new syntax by allowing lambdas which removed the verbosity. Play 2.4 uses Java 8 and some of its examples shrank quite a bit in terms of lines of code.
- zzalpha 11y agoI think he/she meant anonymous classes, not abstract. Akka uses callbacks to handle asynchronous behaviours, which means you need closures, and in Java <8, that means anonymous classes littering your code, which is a real PITA.
- robmcm 11y agoOh yeah, that makes more sense.
- colund 11y agoThe Java 8 syntax improvement is actually shown a bit down the page https://www.playframework.com/documentation/2.4.x/Highlights24#Java-8-support https://www.playframework.com/documentation/2.4.x/Highlights...