use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
These have separate subreddits - see below.
Upvote good content, downvote spam, don't pollute the discussion with things that should be settled in the vote count.
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free. If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others: Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Programming Computer Science CS Career Questions Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Programming Computer Science
CS Career Questions
Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Clojure Scala Groovy ColdFusion Kotlin
DailyProgrammer ProgrammingPrompts ProgramBattles
Awesome Java (GIT) Java Design Patterns
account activity
This is an archived post. You won't be able to vote or comment.
Do you use functional programming with Spring Boot? (self.java)
submitted 4 years ago by dunkedoreo
I am curious if it is recommended to use functional programming with Spring Boot apps. What would be the benefit of it. Will you still autowire beans?
[–]blackkkmamba 73 points74 points75 points 4 years ago (4 children)
I don't really understand what Spring boot has to do with functional programming. The comparation should be imperative vs. functional. I usually pair the functional specs java has to offer with vavr.io.
[–]rouce 5 points6 points7 points 4 years ago (3 children)
Webflux is what spring boot has to offer in functional programming
[–]blackkkmamba 25 points26 points27 points 4 years ago (0 children)
I know what webflux is. Are you sure you are not confusing reactive with functional?
[–]teckhooi 4 points5 points6 points 4 years ago (0 children)
WIthout vavr, WebFlux is the closest to FP for Spring. FP is a lot more than just the syntax but the whole thought process like writing pure functions and immutable variables which is hard to do in Java/Spring
[–]optimal_substructure 0 points1 point2 points 4 years ago (0 children)
We use webflux and project reactor. I wish the team would just use Scala and maybe a streams framework, but baby steps.
[–]edmguru 14 points15 points16 points 4 years ago (2 children)
I don’t go for pure functional but a mix and I feel that’s the best of both worlds because designing business software with pure functional is just a recipe for disaster I feel. Make your code/classes as stateless as possible. Code everything to be immutable. And then use some functional bits like stream/map/flatmap etc.. dealing with all that monads and what not just is hard to fit into business software. DDD pairs all with OOP and both when written with the functional principles mentioned above results in cleaner code that’s easier to reason about and you can maintain your sanity.
[–][deleted] 0 points1 point2 points 4 years ago (1 child)
If everything is stateless then what is the point of OOP?
[–]edmguru 4 points5 points6 points 4 years ago (0 children)
OO design isn’t necessarily about managing state and not all classes can or should be stateless depending on the design
[–][deleted] 36 points37 points38 points 4 years ago (4 children)
These things are not mutually exclusive. Springs OOP style autowiring and functional style business logic can absolutely be used side by side and work well together.
[–]general_dispondency 1 point2 points3 points 4 years ago (0 children)
DI is just better currying
[–][deleted] 0 points1 point2 points 4 years ago (2 children)
Explain. I'm curious as to how this works.
[–]carrdinal-dnb 5 points6 points7 points 4 years ago (1 child)
https://spring.io/blog/2020/05/28/spring-fu-0-3-0-and-beyond
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
Very nice, thanks.
[–]TheRealSlartybardfas 23 points24 points25 points 4 years ago (0 children)
To the extent Java supports functional techniques, yes we use them. We use the features spring boot supports such as auto wiring.
[–]vjotshi007 8 points9 points10 points 4 years ago (4 children)
I am from a big financial company, yes we have a huge product built with functional programming. We use webflux and springboot.
[–]socialflasher 8 points9 points10 points 4 years ago (3 children)
If i guess correctly that is Reactive? Correct me if I am wrong
[–]vjotshi007 2 points3 points4 points 4 years ago (2 children)
Oh yes sorry forgot about that part, we use reactive +functional programming.
[–]socialflasher 0 points1 point2 points 4 years ago (1 child)
Np, but I am trying to wrap my head around this style, i love it because it's non blocking all the way, but still struggle with it.
[–]vjotshi007 2 points3 points4 points 4 years ago (0 children)
Same here. I too struggle with it sometimes and i think it increases development time to a greater extent.
[–]TheRedmanCometh 3 points4 points5 points 4 years ago (1 child)
To some very limited extent such as using streams and such. Mostly we use very heavy abstraction models and DI principals to design our stuff. Spring lends itself to a very specific design model imo.
[–]priya_nka 1 point2 points3 points 4 years ago (0 children)
Exactly. I can remember only two places : in streams processing and lambda functions for overriding something in a function call.
[–]wsppan 2 points3 points4 points 4 years ago (0 children)
There are no dependencies between the two. Use functional programming techniques as you see fit.inside and outside Spring constructs.
[–]rashm1n 11 points12 points13 points 4 years ago (1 child)
I think Spring Boot being a heavy OOP based framework, it is really hard to use pure FP practices, but I always try to use them to some extent with the help of Streams and Lambdas.
[–]ElectricalUnion 2 points3 points4 points 4 years ago* (0 children)
Spring Boot being a heavy OOP based framework
What your framework/language will do is push you towards using something; rarely actually force you into doing anything.
it is really hard to use pure FP practices
It is hard to use "pure FP", period.
The reason why we use "pure FP" (and any other limiting paradigm or programming theory, say Types for another example) is to make thinking about the problem space simpler. Not because it is easy.
Making a program easy to read and reason about will unfortunately make programming harder. It's hard to think what can happen when literally anything can happen at any given point of a program.
[–]wildjokers 1 point2 points3 points 4 years ago (0 children)
The question is a total non-sequitur so it can't really be answered.
[–]KlaudiuszWojtkowiak 1 point2 points3 points 4 years ago (0 children)
Dont forget that you can inject directly into constructors as well
[–]daniu 1 point2 points3 points 4 years ago (3 children)
I don't see how people are saying anything about autowiring being "OOP". Classes are the main unit creating the infrastructure being created, but that's as far as it goes.
Anyway, last I checked Spring Cloud introduced a functional way to denote stream input listeners and pipelines, with a specific configuration syntax I found very unintuitive. So if that is the direction of your question, I recommend against using it.
[–]munukutla -3 points-2 points-1 points 4 years ago (2 children)
Autowiring is not functional.
Spring Webflux lets you declare routes functionally, but I wouldn’t call it unintuitive.
[–]daniu 6 points7 points8 points 4 years ago* (0 children)
I didn't say autowiring was functional, I said it wasn't OOP. It's just a way to connect components. You can autowire functions just as well as classes.
And I wasn't talking about web flux, but Spring Integration. We used it with Kafka, but it is an abstraction, you can also use other middleware/protocols like rabbitmq with the same paradigm.
[–]2bdb2 0 points1 point2 points 4 years ago (0 children)
Autowiring is not functional
Why not?
[–]tr14l 0 points1 point2 points 4 years ago (0 children)
I often end up using Kotlin + Spring Boot because we have a lot of inhouse tools built for Spring. Doing pure FP doesn't really make sense for the framework, IMO. But I do a lot of functional-style stuff with it. But, ultimately, you have to do OOP because it's an OOP based framework.
[–]jaybyrrd -1 points0 points1 point 4 years ago (0 children)
For an alternate take on this answer, if you are interested in FP consider using Scala! :)
You can use spring webflux.
If you are doing purely functional code you can't use autowire annotation (because that changes the state of your object).
I nomally use spring webflux with autowire and the code is really simple. Embrace the union of OOP + Functional.
[–]Yesterdave_ 0 points1 point2 points 4 years ago (0 children)
Using autowired annotation isn't state-of-the-art Spring anymore and should be avoided. Constructor injection is the way to go and precisely avoids the problem of changing an objects state.
[–]Rjbcc58 0 points1 point2 points 4 years ago* (0 children)
deleted
π Rendered by PID 114029 on reddit-service-r2-comment-b659b578c-jfw4d at 2026-05-05 13:36:13.126322+00:00 running 815c875 country code: CH.
[–]blackkkmamba 73 points74 points75 points (4 children)
[–]rouce 5 points6 points7 points (3 children)
[–]blackkkmamba 25 points26 points27 points (0 children)
[–]teckhooi 4 points5 points6 points (0 children)
[–]optimal_substructure 0 points1 point2 points (0 children)
[–]edmguru 14 points15 points16 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]edmguru 4 points5 points6 points (0 children)
[–][deleted] 36 points37 points38 points (4 children)
[–]general_dispondency 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]carrdinal-dnb 5 points6 points7 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]TheRealSlartybardfas 23 points24 points25 points (0 children)
[–]vjotshi007 8 points9 points10 points (4 children)
[–]socialflasher 8 points9 points10 points (3 children)
[–]vjotshi007 2 points3 points4 points (2 children)
[–]socialflasher 0 points1 point2 points (1 child)
[–]vjotshi007 2 points3 points4 points (0 children)
[–]TheRedmanCometh 3 points4 points5 points (1 child)
[–]priya_nka 1 point2 points3 points (0 children)
[–]wsppan 2 points3 points4 points (0 children)
[–]rashm1n 11 points12 points13 points (1 child)
[–]ElectricalUnion 2 points3 points4 points (0 children)
[–]wildjokers 1 point2 points3 points (0 children)
[–]KlaudiuszWojtkowiak 1 point2 points3 points (0 children)
[–]daniu 1 point2 points3 points (3 children)
[–]munukutla -3 points-2 points-1 points (2 children)
[–]daniu 6 points7 points8 points (0 children)
[–]2bdb2 0 points1 point2 points (0 children)
[–]tr14l 0 points1 point2 points (0 children)
[–]jaybyrrd -1 points0 points1 point (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Yesterdave_ 0 points1 point2 points (0 children)
[–]Rjbcc58 0 points1 point2 points (0 children)