..........................................................................
..........................................................................
Disclaimer: I restored this post after having deleted it. Probably not going to make anything work this way, but it is a nice study I think.
So let's start. Lots could be said. Let it keep short: I don't like web apps. The web is meant to transfer information. Browser are meant do display information, not ads nor apps.
Apps should be beautiful and at least behave native. You have to make compromises on cross platform solutions, but native GUI kits are important. (Qt is ugly.)
While I like to code, I have got few time, I'm lazy and I don't like to write boilerplate code.
The heart of every application are data structures. Programming languages are secondary. They just need to be easy, fun and understandable to work with (ok, quite some requirements, I admit).
So I begin with designing database structures and generating code templates from there.
From the great time of Apple's WebObjects there is a free port (or reimplementation) of the good old Enterprise Objects Frameworks (EOF), which is Apache Cayenne. While it is Java as well (just like the posterior WebObjects), it's maintained up to today (praise to Andrus Adamchik) and integrates into modern Java web apps without being as bloated as Spring et. al.
Using Apache Cayenne and it's great CayenneModeler one should be able to quickly prototype a simple desktop app quite well.
This could look like this:
โญโโโโโโโโโโโโโโโโโโโฎ โDatabase: โ โ PostgreSQL โ โ โ โฐโโโโโโโโฒโโโโฌโโโโโโโฏ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โญโโโโโโโโดโโโโผโโโโโโโ โ โ โ โ SWT โ โโโโโโโโโโโค Apache Cayenne โ โ โ โ โ โ Java App โ Code โ โ โฐโโโโโโโโโโโโโโโโโโโฏ โ generation โ โ M V V M โ โ โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ โ โ โ โ โ โ โ โโโโโโโโโโโบ Models โ โ GUI: SWT / JFace โ โ โ โ โ โ โ โ โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GUI modeling for SWT is done using Eclipse WindowBuilder.
DBeaver - Manage any SQL database (PostgreSQL in this case)
Personal website of Andrus Adamchik
Wikipedia: The Modelโviewโviewmodel pattern
GitHub: Implementation of the MVVM pattern for JFace
For prototyping you maybe could even use SQLite instead of PostgreSQL. But chances are high you need to change lots of the database layout for later migration.
Running an app directly connected to a networked database solution like PostgreSQL is no solution for more than personal use deployments of course.
Also you won't be able to run a Java SWT app on many devices nowadays. The biggest market share is mobile. So we need to design an interface for mobile apps. While Cayenne supported Remote Object Persistence (ROP) via Hessian protocol until version 4.2 it is deprecated by that version. And of course you would use a RESTful API for this purpose these days.
Adopting more solutions you get something like this:
โโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโ โ โญโโโโโโโโโโโโโโโโโโโฎ +-+ โ โ โDatabase: โ |S| โ โ โ PostgreSQL โ +-+ โ โ โ โ +-+ โ โ โฐโโโโโโโโฒโโโโฌโโโโโโโฏ |e| โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ +-+ โ โ โ โญโโโโโโโโดโโโโผโโโโโโโฌโโโโถโถโถโถโถโถโถโถโ โ +-+ โ โ โ โ โ โ B โ Java App โ |r| โ โโโโโโโโโโโโโโโค Apache Cayenne โ โ o โ โ +-+ โ โ โ โ โ โ โ o โ Container โ +-+ โ โ โ โ โฐโโโโโโโโโโโโโโโโโโโฏ โ t โ โ |v| โ โโโโโโโโโโผโโโโโโบ Models โ โ i โ โ +-+ โ โ โ โ โญโโโโโโโโโโโโโโโโโโโฎ โ q โ โ +-+ โ โ โ โ โ โ โ u โ โ |e| โ โ โ โ โ Agrest.io โ โ e โ โ +-+ โ โ โ โ โ โ โ โ โ +-+ โ โ โ โ โฐโโโโโโฒโโโโโฒโโโโโโโโดโโโโถโถโถโถโถโถโถโถโ โ |r| โ โ โ โโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ +-+ โ โ โ HTTPSโ โ โ โโถโถโถโถโถโถโถโถโถ โโถโถโถโถโโถโถโถโถโถโถโถโถโถโถโถ โถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโถโ โ โ โ PUT / UPDATE / DELETE โCode โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โgeneration โ โ GET โ โ โโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ C โ โ โ โ โ โ โโโโโฌโโโโโโโดโโโโโดโโโโโโฌโโโโโโ โโโโฌโโโโโโดโโโโโโดโโโโโโโฌโโโโ L โ โ โ โ โ โ โ โ โ โ โ โ JAX-RS / Jersey โ โ โ โ Mantle/RestKit? โ โ I โ โ โ โ โ โ โ โ โ โ โ โโโโโโโโโโโโโโโโโโโค โ โ โโโโโโโโโโโโโโโโโโโโค โ E โ โ โ โ โ โ โ โ โ โโโโโโโโโโผโโโโบ Models โ M โ โโโโโโผโโโบ Models โ M โ N โ โ โ โ โ โ โ โ โ โ โ โ โโโโโโโโโโโโโโโโโโโ V โ โ โ โโโโโโโโโโโโโโโโโโโโ V โ T โ โ โ โ โ โ โ โ โโโโโโโโโโโโโโโโโโโ V โ โ โ โโโโโโโโโโฌโโโโโโโโโ V โ โ โ โ โ โ โ โ โ GUI: โ โ โ A โ โ โGUI: SWT / JFace โ M โ โ โ โ GTK โ UIKit โ M โ โ โ โ โ โ โ โ โ โ โ โ P โ โ โโโโโโโโโโโโโโโโโโโ โ โ โ โโโโโโโโโโดโโโโโโโโโ โ โ โ SWT Java Desktop App โ โ โ Mobile App (ObjFW) โ P โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ S โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Code generation by ObjC plugin
Bootique.io - Framework for runnable Java apps
Agrest.io (Framework for REST data services)
Eclipse Jersey (JAX-RS implementation, client and server)
ObjFW: Lightweight, portable Objective-C framework
1. Finish the Objective-C bindings for GTK(4)
ObjGTKGen: Generates GObject/GTK bindings for ObjFW
2. Wait for ObjFW to have KVO/OFCoding support
ObjFW: Ticket: OFCoding support (FR)
ObjFW: Ticket: KVO support (FR)
3. Port Mantle or RestKit to ObjFW. Currently I don't know yet which ones suites better. I consider it important to bring up a good solution to cache data locally since you don't want to depend on the REST service (aka "the cloud").
GitHub: RestKit (this one was not mainted 3 years longer)
4. Add a plugin to Apache Cayenne to generate fitting Objective-C models (for Mantle/RestKit)
Java IDEs like Eclipse are anything but light on resources and do not work on my old ThinkPad running on 8GB of RAM. Still Apache Cayenne provides abilities that would cost > 495โฌ if you take PHP, Doctrine ORM and Skipper18 under consideration.
It also seems SWT is maintained badly by the Eclipse community. I did not manage to make up an Eclipse configuration to build a SWT app after 4 hours of work.
Update from November 2024: Seems they updated their docs. Managed to get SWT up and running within some minutes. Just had to follow the docs.
https://www.eclipse.org/swt/eclipse.php
Sane app architecture the Java way was published on 2023-09-02.
The content on this site is licensed under CC BY-SA 4.0.
..........................................................................