r/java • u/[deleted] • Jan 01 '20
Java on the Desktop
https://www.youtube.com/watch?v=M1NszZ_K2yk&t=0s27
14
u/nonzero_ Jan 01 '20
The case about hype-driven development is definitely true. Let the requirements decide.. an SPA is not always necessary.
0
Jan 01 '20
I would argue the maintainability aspect of SPAs beats static pages any day. Now that I've started writing SPAs, I'm not ever going back.
4
u/nonzero_ Jan 02 '20
I don't really get this point. Just one example: to make changes in an SPA, be it model or an interface, you always have to adapt two places (SPA + backend), which at least for me always feels tedious and error-prone.
1
Jan 02 '20
That's true of static pages as well, though. You have to adapt the client-side JavaScript to properly be able to handle the modified XML coming from the server.
1
u/pjmlp Jan 03 '20
Most applications are fine with very little JavaScript, so there isn't much to adapt.
What matters is having designers on the team that actually do wonders with CSS.
1
Jan 03 '20
I disagree. The whole thing is a scalability nightmare.
Got an HTML/CSS banner you need to change on 100 different pages? Have fun!
Got a React banner you need to change on 1000 pages? Just edit the component once.
1
u/pjmlp Jan 03 '20
That is what caches are for.
1
Jan 03 '20
Catching static HTML/CSS? You have piqued my interest. Explain.
What you’re suggesting sounds like an iframe.
1
u/pjmlp Jan 03 '20
I am not stating anything extraordinary, just plain old caching of rendered pages, with minimal use of JavaScript for the few screen areas that really require some kind of dynamic behavior.
1
Jan 03 '20
How does this correct needing to update 100 uses of a static HTML and CSS banner?
The caching won’t save you in that instance.
→ More replies (0)1
u/livelam Jan 03 '20
Got an HTML/CSS banner you need to change on 100 different pages? Have fun!
Nobody does this. People use template engines and/or component based frameworks long before SPA is a thing.
Java desktop applications (using AWT or Swing or SWT or JavaFX) are based on components and have nothing to do with static HTML pages.
1
1
Jan 05 '20
"Just would to mention that @GluonHQ Substrate performance is really great...nearly no difference to native...great job"
2
u/javasuns Jan 05 '20
I have been using JavaFX on iOS for a while through the use of RoboVM. The performance is quite good, almost identical as native apps on iPhone 6s and upward. Also, I believe that performance would become as native on both iOS and Android with the upcoming GraalVM
0
u/Capa-riccia Jan 04 '20
I think anyone still considering Java on the desktop should carefully read in what mess TomTom has put itself with its application, which is basically a rom update downloader with a terrible user interface. Which needs a 1.8 JDK on a platform which does not encourage Java and a supplier that is discouraging the use of this version.
This is the horror story in its full development
https://discussions.tomtom.com/en/discussion/comment/1680884
I am using a few Java applications on my desktop: SoapUI, MActor and Idea. The only one with a decent user experience is the IDE. Little surprise, of course: who would develop in a language with a terrible IDE?
The vast majority of applications I have run into, have something in common, that I call "write once, be foreign everywhere". The only cross platform apps I have used, that I really enjoyed using, are made with Electron.
Electron, however, imposes a lot of limitations, since you need a bridge for every native feature you want to use.
I think that Swing was wrong and doomed to fail from day one.
I never investigated JavaFX, but it is not part of OpenJDK, so I would not bet on it.
1
Jan 04 '20
So is this a Java on the Desktop problem or just a Java problem?
1
u/Capa-riccia Jan 07 '20
Very good point. It is a Java problem, which developers could have easily circumvented deploying a JRE inside their application. What is baffling is that the IT department of a major company takes for grantesd a 1.8 Java environment on the target OS.
Aside from the well known changes in licensing from Oracle, Java on MacOS has always been a guest, not particularly liked with little mainteneance.
So, I would take away this point: developing a desktop Java application means taking installation very seriously and anticipating a lot of potential problems.
All the problems regarding performance and user experience keep standing.
3
u/wildjokers Jan 06 '20
that I call "write once, be foreign everywhere"
This boils down to you complaining about java desktop apps not being native enough. Then you say you enjoy Electron. This is baffling as there is nothing more non-native looking than an Electron app.
1
u/Capa-riccia Jan 07 '20
Electron applications require deployment a single executable, not of a Java environment, plus the executable Jars. So, if you must develop a cross platform application, this is a definite plus.
Second, web interfaces can be engineered to be quite similar to native. For example, there is a strong resemblance between Visual Studio Code and Visual Studio.
If you compare SoapUI and Postman in their basic funztionality, in terms of user experience the Electron application is a clear winner.
So, if you have to be cross platform, Electron is a better option, in my view. At least, until I see JavaFX applications compiled to a statically linked executable with GraalVM becoming popular.
3
u/wildjokers Jan 07 '20
Electron applications require deployment a single executable, not of a Java environment, plus the executable Jars. So, if you must develop a cross platform application, this is a definite plus.
Electron bundles its runtime (chromium) with the app. You can can do the exact same thing with Java. There was a slight step backwards taken when
javapackagerwas removed from the JDK in Java 10 sincejavapackagermade it very easy to bundle the runtime. However, you can still bundle the runtime without javapackager and javapackager is coming back asjpackagein Java 14. (It was removed because it was actually part of JavaFX, even though it worked great even for non-JavaFX apps, so when JavaFX was split out javapackager left with it)If you compare SoapUI and Postman in their basic funztionality, in terms of user experience the Electron application is a clear winner.
The Postman interface is a complete and utter mess. It is very hard to distinguish one UI element from another. This is a problem with almost all Electron apps (and web apps in general) since until somewhat recently layout in web apps was a complete hack. There is no way someone can look at the Postman interface and think it is a good example of usability and layout. I have the exact same issue with Visual Studio Code, it can be very hard to tell where one UI element starts and one ends, it is a huge problem when viewing files in the Project view.
1
u/Capa-riccia Jan 08 '20
Very useful information, thanks. I will give one more look at javapackager. Regarding web interfaces, this is an old issue. The hyperlink was thought of as a means of embedding relations within a test and it worked as such, while user interfaces have been thought through long and hard by specialists, to create UI toolkits. Then came the dynamic web and user interface devices exploded in a myriad of paradigms, some of which are definitely non well thought, I agree. In particular, I am not a fan of actions linked to hyperlinks, not buttons. It is always difficult to tell why some actions have buttons and some have less prominent UI triggers.
1
u/_jk_ Jan 06 '20
I never investigated JavaFX, but it is not part of OpenJDK
there is a separate OpenJFX project, also only just started using it myself but jlink should fix the JDK issues
1
u/Capa-riccia Jan 07 '20
Yes, this means that even more attention should go in the deployment process.
I like the concept of JavaFX, as much as I like XAML on Windows: a declarative user interface specification and easily configurable look. I like JavaFX as much as I considered Swing wrong from day one.
I found it disappointing that it had to go on a separate path from OpenJDK.
0
-25
0
Jan 02 '20
[deleted]
2
Jan 02 '20
He states that the performance is "good"... not great... my impression from his talk/experience was that is was "ok", but not the same as the regular toolkits.. (java/swift)
55
u/jpl75 Jan 01 '20
I like Java on desktop. It's still far better for cross-platform UIs than many other alternatives, particularly anything browser-based like Electron.