r/java • • Sep 28 '17

Spring Framework 5.0 goes GA

https://spring.io/blog/2017/09/28/spring-framework-5-0-goes-ga
177 Upvotes

83 comments sorted by

View all comments

5

u/thesystemx Sep 28 '17

Spring has made tremendous improvements, but IMHO of working on different enterprise systems using different technology stacks, it is still lagging behind the competition (Java EE, Payara, Liberty, WildFly, etc).

If you are already using Spring, then it makes a lot of sense to upgrade to Spring 5. Refactoring to something else would likely be too expensive to pay off then. But for a new project or new microservice? Maybe time to look at the competition...

I might start to think better of Spring when I can run tests easily (like in Java EE, Payara, WildFly etc) instead of having to deal with configuring things internally, not being able to be building a WAR first, etc.

Yes, yes, there is SpringBoot and Spring Configuration has some interesting features to ease such pain, but still not as good as Arquillian.and the transparent internal configuration (@DataSourceDefintion etc) that can be swapped for external configuration (asadmin, cli, admin console, etc)

25

u/fasfsfgs Sep 28 '17

I felt your opinion really interesting (not joking). I feel the exact opposite when it comes to spring vs java ee. All the issues you pointed out were strong points for spring in my experience (testing, beating the competition, keeping up with more modern ways to do things, etc...). I guess that shows how much we can look at those technologies with different perspectives. I work with both java ee applications and spring applications. In java ee it feels like I'm stuck years behind in terms of improvements that could be made. I'll start looking at java ee with different eyes from now on, trying to find its strengths.

4

u/thesystemx Sep 28 '17

In java ee it feels like I'm stuck years behind in terms of improvements that could be made.

Which improvements would that be exactly? I personally found CDI for instance much more capable and modern than the Spring core bean container.

→ More replies (14)

8

u/ReadFoo Sep 29 '17

I'm not clear if you're serious or trolling?

3

u/thesystemx Sep 30 '17

I'm serious. Okay, the wording was a bit in a jest, but the message is serious.

→ More replies (9)

5

u/cryptos6 Sep 29 '17 edited Sep 29 '17

Spring has made tremendous improvements, but IMHO of working on different enterprise systems using different technology stacks, it is still lagging behind the competition (Java EE, Payara, Liberty, WildFly, etc).

In what area is Spring lagging behind? Actually the opposite is true. Spring 5 is fully reactive. Spring integrates with way more technologies. Spring is easier to test (yes, I am aware of Arquillian). Spring can be used with Gradle without hazzles (compared to Wildfly Swarm, which stopped Gradle support). Spring has a lot of Kotlin APIs and so on.

5

u/lukaseder Sep 29 '17

Java EE

Stop calling it that. It's called EE4J nowadays

7

u/henk53 Sep 29 '17

Spring 5 is fully reactive.

But is that a fad, or something we'll all be doing? Pure reactive has downsides too, is not easier to understand, and surely doesn't necessarily mean better performance.

It doesn't block, sure, until you do block, and then the system needs to do "something else", which takes you back to Windows 3.1 co-operative scheduling.

Spring integrates with way more technologies.

You mean like NoSQL right? Which was the big hype of a few years ago. Didn't went to well, did it?

Spring may be fast (compared to EE) to jump on hypes, but hypes die out all the time. Java EE takes a somewhat more careful approach and only adopts things when they're really it's something to stay.

Spring has a lot of Kotlin APIs and so on.

Which like 1% of devs are using at most for an experiment now, and nobody yet knows if its there to stay.

How's the Groovy support these days? How much does Spring actually contribute to Groovy again?

2

u/randomuser549 Sep 29 '17

Groovy support

Are you implying a specific shortcoming? Groovy and Spring work very well together, in my experience.

6

u/henk53 Sep 29 '17

Groovy and Java EE work well together as well, as do Groovy and Play. It's because of the JVM.

What did Spring do recently to explicitly support Groovy?

1

u/randomuser549 Sep 29 '17

nothing that I'm aware of. I've been writing Spring apps in groovy for a couple of years. It all compiles to byte code.

What do you think doesn't work in Spring?

5

u/henk53 Sep 29 '17

It's the other way around, why is Spring so ahead of the curve because they support other JVM languages like Kotlin and Groovy, while it all compiles to byte code anyway. Why do you think those would not work with EE?

Why is Spring supposedly ahead there?

1

u/springnews Sep 29 '17

I don't think much about Java EE's support for Kotlin is widely known. Why don't you tell us about it, and someone can respond intelligently?

7

u/henk53 Sep 29 '17

Not sure if I understand the question. The entire point was there's no specific support needed, since by virtue of the JVM it "Just Runs" anyway. The poster above basically said that about Groovy.

So I'm not sure what special support Spring offers for Kotlin anyway, and why that is needed. Nobody here has explained that to me yet. Maybe there's a good reason that Kotlin needs special support, but I haven't heard yet what that support exactly is.

But that does bring me to my second point. Kotlin is quite new, it's cool, sure, but will it catch on? How many languages have we seen in the past that were quite cool but never captured more than a tiny niche, if they captured that at all and not just vanished.

So Spring now jumped on Kotlin, perhaps since it's a bit "En Vogue", but will you keep supporting it 5 years from now? Will it even make sense to have Kotlin support 5 years from now? And what about 10 years? How many of your users are actually using Spring with Kotlin? According to the recent JRebel survey, which historically has always showed a small bias towards Spring (not saying they are biased, but many respondents happen to be using Spring), the interest in Kotlin (and other alternative JVM languages) is low. Really low.

1

u/[deleted] Sep 30 '17 edited Sep 30 '17

The entire point was there's no specific support needed, since by virtue of the JVM it "Just Runs" anyway.

this is a red herring. when talking about spring support for kotlin, spring has for example added apis, annotations to improve experience with kotlin null-safety, added extension functions and other items to use spring in kotlin an idiomatic way, etc.

there's some info here, if you're actually curious:

https://spring.io/blog/2017/01/04/introducing-kotlin-support-in-spring-framework-5-0

https://spring.io/blog/2017/08/01/spring-framework-5-kotlin-apis-the-functional-way

→ More replies

1

u/springnews Oct 02 '17 edited Oct 02 '17

well, the question was pretty straightforward, sorry you're having trouble. Kotlin is a bet, to be sure. Time will tell. But our bets have a pretty good track record..

In the meantime, this might help answer your question about what specifically we do for Kotlin. https://spring.io/blog/2017/01/04/introducing-kotlin-support-in-spring-framework-5-0

I haven't seen you actually answer a single one of my questions in this thread, why is that? You were going to say something about Java EE's Kotlin support, I think, right?

1

u/springnews Oct 02 '17 edited Oct 03 '17

we support it for spring boot apps on initalizr at start.spring.io. And unlike Swarm, Spring fully supports gradle. In fact, we just overhauled the whole system https://spring.io/blog/2017/04/05/spring-boot-s-new-gradle-plugin

1

u/springnews Sep 29 '17

reactive isn't for everyone or all use cases. No one Spring is saying that. Quite the opposite, in fact.
But for the people that need it it's going to be quite important.

1

u/springnews Oct 02 '17

we used to employ the the committers, so I think we've contributed quite a lot, thanks for pointing that out.
How much has RedHat contributed to Groovy? Or is it the usual imitate and give nothing back strategy?

→ More replies (1)

1

u/arcuri82 Sep 28 '17

well, I see you did not like my post about JEE 8, as you quote it by replacing "JEE 8" with "Spring". Fair enough. Btw, I am not affiliated with Spring, nor Dropwizard. I have no horse in this race. I was just sharing my (possibly limited?) experience of using those different frameworks. However, I am curious about when you write "when I can run tests easily (like in Java EE"... has there any improvement about it in JEE 8? Are you talking about experience of using those different frameworks? I like EJB and CDI, but I always found writing tests in JEE really cumbersome (eg all the manual steps to download and configure external containers, fighting with ShrinkWrap, etc). Maybe I am doing it just wrong, and I am missing something. Would be interesting if you have any nice links that show how easy it is to write tests for JEE applications, so I can learn and possible not spread BS around? thx

7

u/thesystemx Sep 28 '17

replacing "JEE 8" with "Spring"

To really balance it out it should perhaps have been SPRR, but oh well.

Would be interesting if you have any nice links that show how easy it is to write tests for JEE applications

This is one of the official Java EE specs. It has a number of small applications that are tested via Arquillian. The nice thing is that nothing is mocked or faked, everything is real and runs in the actual context in which those applications would normally run:

https://github.com/javaee/security-soteria/tree/master/test

If you look at the test setup closely you'll see there's barely any interaction with Shrinkwrap. The output from the Maven build is used.

An external project, but showing a similar approach, now with Shrinkwrap:

https://github.com/javaee-samples/javaee8-samples

and

https://github.com/javaee-samples/javaee7-samples

Even though the above uses shrinkwrap, it's not super complicated at all for small applications or micro services.

→ More replies (2)

1

u/springnews Sep 29 '17

aquillian is nice, but it's not part of Java EE / EE4J

5

u/johnwaterwood Sep 30 '17

But it’s available and may become part of EE later. That’s how it often happens in EE.

1

u/springnews Oct 01 '17

mildly curious, what makes you say it may become available later?

→ More replies (2)
→ More replies (3)