A "nice to have" simple (????) addition to AI

96 views
Skip to the first unread message

Harry Mangurian

unread,
9 Aug 2017, 08:30:2109/08/2017
to MIT App Inventor Forum
Question for MIT folks:  How difficult would it be for the AI developers to do the following ?

Modify all tags in Tinydb calls to append the name of the Tinydb being addressed and then strip that name in methods when tags are retrieved, so that the appendage is transparent to the user. 

That is to say - for a Tinydb named MYdb,     "tag1" is stored internally as tag1MYdb, "tag2" as "tag2MYdb" etc.  

This makes each Tinydb storage, with a unique name, look independent to the app developer.  Barring that capability, I guess the app developer could write subroutines to append/remove the Tinydb name before using a tag.

Evan Patton

unread,
9 Aug 2017, 09:17:3009/08/2017
to MIT App Inventor Forum
One challenge with this is backward compatibility with the many existing apps that are already published. The TinyDB is persisted as an XML file, and so when upgrading an app with old tags lacking the prefix, it will appear as though all of the data are lost (i.e., all lookups will occur with new, prefixed tags). The other thing right now is that the names of components are not known to those components. They are provided in the UI for the purpose of user identification only. For example, if you create two TinyDB objects, it wouldn't matter that their names are TinyDB1 and TinyDB2 or MyDB1 and MyDB2--they have no knowledge of this. I think in some ways though we could incorporate this idea into something else that we are exploring, namely adding namespaces to TinyDB. The underlying problem here is that when you use the companion app to develop multiple applications, you can have one project's TinyDB overwrite keys from another project's TinyDB because the TinyDB in the companion is shared across all of the projects (the Companion also uses its own keys in TinyDB, and so you can potentially break your companion if you overwrite those).

I'll reference this discussion on GitHub and we'll see what we can do about properly designing it.

Evan

Reply all
Reply to author
Forward
0 new messages