Live data from Hacker News

Ask HN: What are modern architecture patterns for desktop applications?

news.ycombinator.com

21–25 of 25 posts

Re: Ask HN: What are modern architecture patterns for desktop applications?

#21
Make everything in-process otherwise you sold the main benefit of desktop.

The architecture for the “backend” isn’t different from a web or other app, the difference being that you don’t need to expose a api/rpc surface of any kind that isn’t regular methods.

Set up some good interfaces and/or view models. This will depend heavily on which front end. An imgui app will have very different preferences from a databound ui and so on. Very hard to make recommendations about this part without knowing what frameworks will be used.

But don’t pretend a desktop app is a web app.

Re: Ask HN: What are modern architecture patterns for desktop applications?

#22
Not at all a fan of apps that run a webserver locally and interface through a browser. Will make a rare exception, but I wouldn't use one long term. Not exactly what you are asking, but similar.

I do like the mature pattern of having a number of CLI programs that can be run, and an additional GUI that can run them as well, for non-expert or infrequent users. Have a log that shows what commands are called by the GUI. This gives powerful automation potential for free. Look at Handbrake GUI wrappers for technical inspiration, if not UX design.

Then you can do whatever IPC you like, can be as simple as reading from stdin/out or maybe Unix sockets before resorting to TCP/IP. If work has to be done outside of the user session, write a service/systemd module definition with one of the CLIs.

Re: Data, as others mentioned sqlite can stretch a lot farther than was commonly believed until a short while ago. Try before resorting to servers.

Re: Ask HN: What are modern architecture patterns for desktop applications?

#23

As an old timer it's pretty hard to take this post seriously. I honestly can't tell if it's a troll or not. I'm not trying to offend, more to point out that there are some big generational gaps in software development.

It's true, but not entirely different than someone saying they've only built DOS apps and now want to build a Mac application and having quite a few misconceptions along the way. At least how I read it.

Re: Ask HN: What are modern architecture patterns for desktop applications?

#24
I worked on an embedded system in the logistics industry where one process drove rendering on screen, and two other processes did a lot of the backend work and implemented lots of business logic.

They communicated over IPC.

This was design this way on purpose, because the back end processes were existing applications. Rather than re writing them entirely, the developers added IPC communication.

Also, they believed it was better for a separate process to crash and just restart rather than showing it to the user and confusing them (the person delivering products to a grocery store).

The whole thing was a convoluted mess.

My advice to you is start simple. You don’t need multiple processes unless there’s a damn good reason. Everything should be a single process.

Re: Ask HN: What are modern architecture patterns for desktop applications?

#25
you can leave your web stuff at the door. unless you have a really good reason to use client/server architecture, or make everything async, just write your monolithic desktop app using a framework like QT which will interface with a database out of the box. or you can interface with sqlite directly. if you only need windows or mac support you can use platform specific languages and UI frameworks.
Post reply on HN