Power Programming With One Way Programs, Metadata, And Application Models
Power Programming With One Way Programs, Metadata, And Application Models

Monday • May 8th 2023 • 10:07:14 pm

Power Programming With One Way Programs, Metadata, And Application Models

Monday • May 8th 2023 • 10:07:14 pm

(I am pretty much making up all these names as I go, they won’t seem familiar to other programmers.)

A one way program does not allow you to edit the data it presents, rather it tells you where it is, so that you can edit it with your editor.

In a traditional program your data does a round trip, you load it into the UI, edit it, send it to server, server sends it back, and you can edit it again.

So you are really writing a half program, though it is still very useful, it only takes a fraction of time to program it.

Another power trick is adding metadata about your stuff, into the program you are working on.

Programming languages, do have the ability to reflect upon themselves, and JavaScript along with extra frameworks on top does it well.

But when you do it on your own, you can make that richer and more uniform, and you won’t have to twist code around so much.

Application Models are programs with out text or graphic user interfaces, they are purely an object in your program.

They are fully functional programs, that can be tested, and controlled, by they require a program around it.

It is like API, crafted around all the needs of a particular application, but it is completely standalone, and you need a programming language to use it.

It is not an application, but a beautiful and complete application model, with built in security, authentication, authorization, management, everything.

These three things are, interesting, but mostly have been done, and are not at all ground breaking.

But when you put those ideas together, and stack their powers...

You can rapidly prototype, or create secure applications, and pretty much universal foundations they can run on top of.

I recommend using an Object to Relational Database Mapper like Objection.js inside your Application models, which will give you easy database migration or upgrades and seeding.

And then node-http-proxy which will help you gather all your network stuff, in one place, where you can easily switch things around.

Finally, if one way applications don’t take you far enough, before adding the round trip system.

Consider integrating with CodeMirror, a code editor that will run in the browser.

This is especially useful, and safe when you run your server locally, in development mode.

But it can also work for administrators, you can simply convert data to a friendly format like YAML.

Let the administrator edit things in that format, under the watchul eye of JSONSchema, and when they click save, convert it back to JSON and send it into the application model.

YAML may seem scary, but Wikipedia users didn’t complain about WikiText, so your users or alest administrators may enjoy YAML.

Where they don’t have to use a mouse to click in little squares, and can freely move around structured text…

With proper guidance and unobtrusive warnings, from the schema validation system.

Artwork Credit