News for hackers. Stuff that matters.
Re:A categorized list of all Java and JVM features since JDK... by tonyarkles on Thursday April 01, 2021 @01:06PM (#26663262)
Now we've got Spring, which in my, admittedly limited, experience does a great job of transforming what could have been compile-time errors into run-time errors.
Re:A categorized list of all Java and JVM features since JDK... by jacques_chester on Thursday April 01, 2021 @01:26PM (#26663540)
The wheel of karma is ever-turning, though [0],[1].

Disclosure: I work for VMware, which sponsors Spring development.

[0] https://spring.io/blog/2021/03/11/announcing-spring-native-b...

[1] https://github.com/spring-projects-experimental/spring-fu

Re:A categorized list of all Java and JVM features since JDK... by victor106 on Thursday April 01, 2021 @03:55PM (#26665255)
Spring native is a game changer for so many organizations using containers for startup times. There are other spring related issues you still have to deal with
Re:A categorized list of all Java and JVM features since JDK... by The_rationalist on Thursday April 01, 2021 @02:00PM (#26663960)
Those are nice advances but I hope that spring will one day support compile time validation of generated queries and of beans like Micronaut do.
Re:A categorized list of all Java and JVM features since JDK... by jacques_chester on Thursday April 01, 2021 @02:22PM (#26664204)
I'm confident it'll reach that point.
Re:A categorized list of all Java and JVM features since JDK... by noisem4ker on Thursday April 01, 2021 @02:32PM (#26664322)
...and probably well before Micronaut gets rid of its bugs, comes close to feature parity and generally matures as a framework.
Re:A categorized list of all Java and JVM features since JDK... by avmich on Thursday April 01, 2021 @01:51PM (#26663840)
Well said :) . Spring looks so much as to show how useful ideas can be misapplied with catastrophic results. For example, liberate encouraging of dependency injections leads to multitude of interfaces which are only ever implemented once by a production code class, and maybe one more time by a test class, even though Java has all methods virtual and testing could be done without requiring the interface.
Re:A categorized list of all Java and JVM features since JDK... by oftenwrong on Thursday April 01, 2021 @03:39PM (#26665084)
It's reasonable to provide a single implementation of an interface, if the goal is to facilitate dependency injection for that component. The problem I find with Spring is that it is designed for dependency injection at all levels of its architecture, leading it to be one of the ultimate examples of Ravioli Code.

https://wiki.c2.com/?RavioliCode

DI is a powerful concept, but Spring projects rely on DI in such a generic way that it often doesn't even make sense for your application. You have to gain intimate knowledge of the abstractions, and inject a bunch of code in a bunch of places just to make it do the very-straightforward thing you were trying to do.

Re:A categorized list of all Java and JVM features since JDK... by avmich on Friday April 02, 2021 @02:32PM (#26674351)
> It's reasonable to provide a single implementation of an interface, if the goal is to facilitate dependency injection for that component.

You don't really need dependency injection if there is only single choice of what to inject. You can just refer in code to the only possible component.

Re:A categorized list of all Java and JVM features since JDK... by mamon on Thursday April 01, 2021 @02:05PM (#26664010)
>> Java has all methods virtual and testing could be done without requiring the interface.

Not sure what you mean by that. I thought that interface/implementation divide is the way to implement virtual calls. Unless you want testing frameworks to do bytecode instrumentation.

Re:A categorized list of all Java and JVM features since JDK... by avmich on Thursday April 01, 2021 @02:50PM (#26664554)
If your interface is going to be implemented by just one class, I'd offer to skip interface - it reduces amount of code. If you still need to pass, as a parameter, a class A in order to test a class B, you can instead pass class C inherited from A, with all necessary methods overloaded.

If you just create a class A in java, no interfaces involved, class A will have its methods virtual. I'm not sure what do you mean by interface/implementation divide.

Re:A categorized list of all Java and JVM features since JDK... by nitrogen on Thursday April 01, 2021 @02:46PM (#26664501)
Modern testing frameworks can indeed mock concrete classes, which beats the bytecode generation that Spring would be doing anyway.
Re:A categorized list of all Java and JVM features since JDK... by blntechie on Thursday April 01, 2021 @04:07PM (#26665389)
Running ‘mvn install’ on even a simple Spring project with default dependencies is scary to watch on the console. So many things happen and it’s not even the verbose mode.

Running ‘dotnet build’ is much more saner and one can reasonably understand what happens.

Re:A categorized list of all Java and JVM features since JDK... by frant-hartm on Thursday April 01, 2021 @06:48PM (#26667232)
Try `npm install` then..
Re:A categorized list of all Java and JVM features since JDK... by The_rationalist on Thursday April 01, 2021 @02:00PM (#26663953)
Just use micronaut if compile time errors is what you want. It can even validate generated queries.
Re:A categorized list of all Java and JVM features since JDK... by specialist on Thursday April 01, 2021 @08:31PM (#26667954)
Spring is a flow of control obfuscation framework.
Re:A categorized list of all Java and JVM features since JDK... by geodel on Thursday April 01, 2021 @03:26PM (#26664947)
Yep. Give it a one line error description and it turn into stack trace longer than "War and Peace".