-
Notifications
You must be signed in to change notification settings - Fork 30
Is Flux/Redux "better than" MVVM? #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Java_MVVM_with_Swing_and_RxJava_Examples is therefore likely "deprecated" |
It will be interesting! I try to choose the right way to write swing gui. |
Hi Peti, Do you use Redux with Swing in your day job or with JavaScript/React? |
Hi Manuel, nice hearing from you! :-) You are absolutely right IMHO that vanilla Java is not ideal to implement Redux for the JVM. The main reason for this is the lack of immutable/persistent datastructures to implemented the "immutable state". However, with a little bit of "salt" like https://immutables.github.io/ or the usage of "alternative" JVM languages like Groovy with it's @immutable annotation or even "better" Kotlin, Scala, ... this is easy to overcome. Combined with a nice reactive programming library like RxJava (targeting Java 6 and Android), Reactor (targeting Java 8), akka-stream, or ... the implementation of Redux for the JVM becomes quite a good fit. At the moment we use our closed source inhouse Redux port for our Vaadin and Swing based applications. Best regards, PS: Meanwhile there are a few opensource redux ports for the JVM out there, but they are all IMHO in a early stage and/or bound to a specific view-technology (e.g. "only for JavaFX") |
You are right. I also like Kotlin for this. I know reduxfx which I find really interesting but lacking some features like FXML support yet. A production-ready java redux library that is independend of UI toolkits would be nice. |
Uh oh!
There was an error while loading. Please reload this page.
I came to the insight, that the Flux/Redux Pattern is "better than" MVVM.
The main point is a better understanding/debugging of the flow of events.
In MVVM we have typically databinding, sometimes bidirectional, sometimes on different threads. At runtime the events in the application are like a gunfight with bullets flying from/to all kinds of directions.
In Flux/Redux, we have in contrast the unidirectional dataflow, which makes it easy to understand/debug the system. This is more like a shooting range. The bullets fly from A to B.
In my day job I switched over from MVVM to Redux and think it "is better". Unfortunately I didn't have time to share some code.
The text was updated successfully, but these errors were encountered: