2014년 12월 9일 화요일

"when WebDB .GotValue" is triggered eventhough there is nothing in the webDB

See the screenshot of my few simple blocks, please (attached).

This is derived (and simplified) from the "Quizme" trivia example in the tutorials.

SIMPLIFICATION:
No call to "WebDB .StoreValue" is made at all to ensure that there is no value in the webDB for my particular testing tag.
(notice that all "WebDB .StoreValue" instructions are de-activated as visible in the screenshot)

TESTING:
At launch of my app on my cell (connected through WIFI), the block "when WebDB .GotValue" ends with displaying the message "was here!" in a label.

ASSESSMENT:
This means the instruction "when WebDB .GotValue" was executed whereas nothing was returned at all. I was expecting this event not to be triggered when nothing has to be - and actually nothing is - returned.

REPLY:
"taifunb...@gmail.com" wrote me back that, since the call to "TinyWebDB.GetValue" is performed during "Screen.Initialize", then the "TinyWebDB.GotValue" event will ALWAYS be triggered, whether there is a value returned or not.

WORKAROUND?
A work around might be to check every time if the returned value is or not empty. At the same time, my understanding of taifunb...@gmail.com's answer is that  the "when WebDB .GotValue" event will NOT be triggered if "TinyWebDB.GetValue" is performed somewhere in my logic but after the "Screen.Initialize".

Is this the right understanding?

QUESTION:
It seems assumed that the "empty" value is meaningless for a "when WebDB .GotValue" event. But if the "empty" value were needed and meaningful, then we would be stuck.

SEMANTIC:
Does it make more sense to not trigger the "when WebDB .GotValue" event when no value is found in the WebDB? If nothing is found, another event likely named "when WebDB .NoValueGot" would be preferable, don't you think?

In other words, assuming only a single event will be maintained for returning results from a DB request, an event named "when WebDB .GotValue", that currently gets triggered even when no value is got, should rather be named something like "when WebDB .RequestReply".

What do you think?

NOTE:
I had opened the issue 2843 on this, but I was replied that this is more for the Forum  :)
I love this AI2 tool, indeed. That is fun ... to the extent it does what it says  :)
(communication is mother of all ailments, right?)




it seems to be you are thinking too complicated?
each time you send a TinyWebDB.GetValue to the database, the TinyWebDB.GotValue event will be triggered and if there is no value, an empty string will be supplied
Your new answer states that the TinyWebDB.GotValue will always be triggered, whether there is a value or not for one’s request; clear, thanks  :)
 
Your initial answer was suggesting that triggering a TinyWebDB.GotValue event - with no value returned - could be dependent on performing a TinyWebDB.GetValue during Screen.Initializep or elsewhere in the logic.
 
So, the question seemed not to be about my thinking being or not simple, this was was more about you expressing or not yourself clearly, right?   :)
 
Nevertheless, I have my closure. Thanks :)
 
P.S.: pardon me if I give you the feeling of being heavy. I will turn 60 not that far, I learnt English when I was already 40, and more importantly, I spent all my life in IT and got used - BTW, that is a general paradigm – to see DB calls replied with both a status and data, all together, but not “melted” down into one variable. Thanks for working on that nice AI2 tool, though  :)

댓글 없음:

댓글 쓰기