This is a bit of a weird one. After reading this:
I got to thinking about using fibery for a self-describing system, and I have made an app that does some interesting stuff (I think).
My app is called Metamodel, and the idea behind it is that Metamodel describes the types/fields/relations to be found in another app, called Model.
This will sound a bit crazy, but bear with me…
Metamodel contains three types, called Type, Field and Relation.
- Each entity of the type Type defines a type that is to be created in the Model app.
- Each entity of the type Field defines a field that is to be created in the Model app
(for the type in the Model app that corresponds to the Type entity to which the Field entity is related).
- Each entity of the type Relation defines a relationship to be created in the Model app between two types (which are the types corresponding to the two Type entities that the Relation entity is linked to).
What this means in practice is that a user can make entities in the Metamodel app, and then with a press of a button produce an app structure in the Model app accordingly.
Of course, this is a ridiculous idea, since the time spent making entities in Metamodel to achieve the Model app structure is much more than the time it would take to create the Model app structure directly.
However, the point was not to make something useful per se, but to give an indication of what is possible, so that the @Borealys and @Louis-Felix could be inspired to figure out a way to achieve something useful in fibery to meet their needs.
When reading about what they were trying to do, it struck me that they needed fibery to be dynamic and self-describing to a certain extent, so that, for example, fields would be present or absent dependent upon the values of other parts of the system.
Anyway, there’s lots of things that are wrong with what I’ve created (the code doesn’t check for the existence of types/fields before trying to create them, for example, and I’m sure my coding is terrible in many other ways - thankfully, I just don’t know how bad it is cos I’m not a SW dev - ignorance is bliss!).
But if it inspires someone to figure out how they could solve their own problem, then I’ll be happy.
Here it is:
To use it, import it into your workspace, create an empty app called Model, and press the ‘Create’ button that exists for either of the entities Person or Parcel.
If everything works, Model will suddenly have a couple of new types, each with fields, and related to the other/itself.
p.s. I did originally intend to instantiate the app called Model directly, but I can’t see that it is supported by the API
p.p.s When my mind wanders, I think about writing a script that creates new types/entities within the Model app that are identical to the Metamodel app types/entities, and thus achieving a fully self-replicating app! Feel free to add your suggestions for where you think the craziness could go…