๐Ÿง‘โ€๐Ÿ’ป๐Ÿ John's Gemini capsule ๐Ÿฏ

 

..........................................................................

๐Ÿ›– home page

๐Ÿง‘โ€๐Ÿ’ป about me

โœ‰๏ธ contact info

..........................................................................

 

Sane app development

 

How to write a Free and Open Source (FLOSS) application, that works cross platform - at least on some (mobile) platforms?

 

2nd take, the poor man's approach

 

In a first attempt of writing this gemlog post I tried to put in place and utilize the business-solid Java ecosystem. But when trying it out I recognized that it is not sane at all. At least to me. Its heavy resource usage, complexity and, uhm, heaviness, make it too hard to handle for me. The process eats the joy of development instead of spreading it as soon as you start one of the common Java IDEs (knowing that JetBrain's IDE is one of the better examples).

 

Now I'm writing this blogpost using Sublime Text again and put in place a collaboration of solutions I consider sane because it fits to my resources available and hopefully to the possibilities of people using a solution I built upon this plan.

 

It's built upon the foundation of the C language, its Free and Open Source compilers, the GObject/GLib ecosystem and easy to handle wrappers around it like Objective-C (leveraging ObjFW) and PHP.

 

As a foundational layer for structuring data I'd try to utilize Midgard accessed through an Objective-C wrapper for ObjFW.

 

That said, the approach below is heavily based upon upcycling old, mostly abondoned, but slim and slick software.

 

See notes about app development regarding Midgard

 

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.)

 

App development using local data storage

 

  โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
  โ•‘ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ               โ•‘
  โ•‘ โ”‚   Database:         โ”‚      ___      โ•‘
  โ•‘ โ”‚       SQLite        โ”‚     /\  \     โ•‘
  โ•‘ โ”‚                     โ”‚    /::\  \    โ•‘
  โ•‘ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ฒโ”€โ”€โ”€โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ   /::\:\__\   โ•‘
  โ•‘ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ   \/\::/  /   โ•‘
  โ•‘ โ”‚      libgda         โ”‚     /:/  /    โ•‘
  โ•‘ โ”‚โ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ”‚     \/__/     โ•‘
  โ•‘ โ”‚                     โ”‚      ___      โ•‘
  โ•‘ โ”‚      Midgard2       โ”‚     /\  \     โ•‘
  โ•‘ โ”‚                     โ”‚    /::\  \    โ•‘
  โ•‘ โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚   /::\:\__\   โ•‘
  โ•‘ โ”‚ โ”โ•บโ•บโ•บโ•บโ•บโ•บโ•บโ•บโ•บโ”“         โ”‚   \/\::/  /   โ•‘
  โ•‘ โ”‚ โ•Midgard  โ• ObjC/   โ”‚      \/__/    โ•‘
  โ•‘ โ”‚ โ•based    โ• ObjFW   โ”‚               โ•‘
  โ•‘ โ”‚ โ•Models   โ• wrapper โ”‚      ___      โ•‘
  โ•‘ โ”‚ โ”—โ•บโ•บโ•บโ•บโ•บโ•บโ•บโ•บโ•บโ”›         โ”‚     /\  \     โ•‘
  โ•‘ โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚    /::\  \    โ•‘
  โ•‘ โ”‚ UI:     โ”‚           โ”‚   /::\:\__\   โ•‘
  โ•‘ โ”‚    GTK  โ”‚  UIKit    โ”‚   \/\::/  /   โ•‘
  โ•‘ โ”‚         โ”‚           โ”‚      \/__/    โ•‘
  โ•‘ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ               โ•‘
  โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

 

What needs to be done to achieve this type of app?

 

1. Finish the Objective-C bindings for GTK(4) and the GObject ecosystem

 

ObjGTKGen: Generates GObject/GTK bindings for ObjFW

 

2. Update Midgard and libgda to work with current dependencies

 

As Midgard depends on libgda both need to be updated to work with current databases. This concerns sqlite3 and PostgreSQL since libgda 5 only supported PostgreSQL up to version 11 but needs to work with version 15.

 

Well, that's it. From this I should make a working app using a solid foundation. Let's see what I come up with.

 

Sane app architecture

 

Further elaborting:

 

Running an app directly connected to a networked database solution like PostgreSQL or only using SQLite is no permanent solution for deployments that address more than only personal use cases of course. I'm thinking of organizational use cases which depend on a single common data source and service providing it.

 

So make let's make the approach above a more grown architecture by putting in place PostgreSQL and some well established PHP solutions:

 

 โ”Œโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ”
 โ•Ž    โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                                     +-+         โ•Ž
 โ•Ž    โ”‚Database:         โ”‚                                     |S|         โ•Ž
 โ•Ž    โ”‚    PostgreSQL    โ”‚                                     +-+         โ•Ž
 โ•Ž    โ”‚                  โ”‚                                     +-+         โ•Ž
 โ•Ž    โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ฒโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                                     |e|         โ•Ž
 โ•Ž  โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ”‚โ•โ•โ•โ”‚โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—        +-+         โ•Ž
 โ•Ž  โ•‘ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ•ฎ                         โ•‘        +-+         โ•Ž
 โ•Ž  โ•‘ โ”‚      Midgard     โ”‚  โ•Žโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ”                โ•‘        |r|         โ•Ž
 โ•Ž  โ•‘ โ”‚      PHPCR       โ”‚  โ•Ž   S    โ•Ž    PHP         โ•‘        +-+         โ•Ž
 โ•Ž  โ•‘ โ””โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”˜  โ•Ž   y    โ•Ž                โ•‘        +-+         โ•Ž
 โ•Ž  โ•‘  โ”‚Doctrine/CR ODM โ”‚   โ•Ž   m    โ•Ž    FastCGI     โ•‘        |v|         โ•Ž
 โ•Ž  โ•‘ โ•ญโ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ•ฎ  โ•Ž   f    โ•Ž                โ•‘        +-+         โ•Ž
 โ•Ž  โ•‘ โ”‚                  โ”‚  โ•Ž   o    โ•Ž    Nginx/      โ•‘        +-+         โ•Ž
 โ•Ž  โ•‘ โ”‚   FOSRestBundle  โ”‚  โ•Ž   n    โ•Ž    Apache      โ•‘        |e|         โ•Ž
 โ•Ž  โ•‘ โ”‚                  โ”‚  โ•Ž   y    โ•Ž                โ•‘        +-+         โ•Ž
 โ•Ž  โ•‘ โ•ฐโ”€โ”€โ”€โ–ฒโ”€โ”€โ”€โ”€โ”€โ”€โ–ฒโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ”˜                โ•‘        +-+         โ•Ž
 โ•Ž  โ•šโ•โ•โ•โ•โ•โ”‚  โ•โ•โ•โ•โ”‚โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•        |r|         โ•Ž
 โ•Ž        โ”‚ HTTPSโ”‚                                             +-+         โ•Ž
 โ””โ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ”‚โ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ”‚โ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ•ถโ”˜
          โ”‚      โ”‚
      GET โ”‚      โ”‚ PUT / UPDATE / DELETE
          โ”‚      โ”‚
  โ”Œโ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”          C
  โ”‚  โ”‚ Mantle/ โ”‚ Local   โ”‚   โ”‚
  โ”‚  โ”‚ RestKit โ”‚ Midgard โ”‚   โ”‚          L
  โ”‚  โ”‚         โ”‚ Cache   โ”‚   โ”‚
  โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค   โ”‚          I
  โ”‚  โ”‚                   โ”‚   โ”‚
  โ”‚  โ”‚   Midgard based   โ”‚   โ”‚          E
  โ”‚  โ”‚                   โ”‚   โ”‚
  โ”‚  โ”‚      Models       โ”‚   โ”‚          N
  โ”‚  โ”‚                   โ”‚   โ”‚
  โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค   โ”‚          T
  โ”‚  โ”‚ GUI:    โ”‚         โ”‚   โ”‚
  โ”‚  โ”‚  GTK    โ”‚  UIKit  โ”‚   โ”‚
  โ”‚  โ”‚         โ”‚         โ”‚   โ”‚          A
  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
  โ”‚   Mobile App (ObjFW)     โ”‚          P
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                        P

                                        S

 

Midgard2

Midgard2 PHPCR

Symfony framework

Doctrine ORM

Doctrine PHPCR ODM

GitHub - FOSRestBundle

 

What needs to be done to achieve the further elaborated architecture?

 

1. Wait for ObjFW to have KVO/OFCoding support

 

ObjFW: Ticket: OFCoding support (FR)

ObjFW: Ticket: KVO support (FR)

 

2. Port Mantle or RestKit to ObjFW. Currently I don't know yet which ones suites better. I consider it important to still have Midgard to cache data locally since you don't want to depend on the REST service (aka "the cloud").

 

GitHub: Mantle

GitHub: RestKit (this one was not mainted 3 years longer)

 

3. Add a plugin to either Midgard or Doctrine to generate fitting Objective-C and PHP models (for Mantle/RestKit)

 

 

Todo list for first preparations

 

Making Glom work again could be useful for quick database prototyping (only for PostgreSQL though).

 

If I update libgda to work with PostgreSQL 15, Glom may work out of the box (maybe). Glom then generally could be used to test libgda's capabilities.

 

https://gitlab.gnome.org/Archive/glom/-/issues/9

 

The next step could be to add the generation of Midgard description files out of the database schema ("reverse engineering") to Glom.

 

 

Sane app development was published on 2023-09-13.

The content on this site is licensed under CC BY-SA 4.0.

..........................................................................

 

๐Ÿง‘โ€๐Ÿ’ป๐Ÿ John's Gemini capsule ๐Ÿฏ - Back to index