KRL Safari: KRUD - Kynetx CRUD with Persistant Variables
To keep the focus on the mechanics a simple data structure is used to demonstrate KRL CRUD ... an array of strings which will be used to implement a tag cloud. The demo provides a web interface to see all of the strings in the tag cloud, add new tags and delete tags. To permit the demo to be accessible to a broad audience, it has been distributed using a site tag. Just visit the demo page to see all of the current tags which have been entered by all who have used the application. You can add a new tag by entering text into the form, then click the Add button. To delete a existing tag simply click on the text of the tag.
While the KRL code has comments thoughout, it should be emphasized that application persistent variables accessed in the rule prelude:
TagCloud = app:TagCloud;And the updated persistent variable are saved in the postlude:
set app:TagCloud TagCloud;Adding a new value to the persistent variable is performed using the union operator:
newCloud = TagCloud.union(cleanTag);Removing a value from the persistent variable is done using the difference operator:
newCloud = TagCloud.difference(tagText);To see the implementation using a complex data structure take a look at Kynetx App A Day 28 Updating User's List When User Joins App.
Hey! Where's the U in KRUD? Multiple choice response:
- Left as an exercise for the reader
- Updated was not needed for demo
- I'm lazy :)
This entry was posted on Feb 4, 2011
, Friday, February 04, 2011 and is filed under crud,kynetx,safari. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response.













