This post originated from an RSS feed registered with Java Buzz
by Fred Grott.
Original Post: DSL in Mobile Web Applications
Feed Title: ShareMe Technologies LLC-The Mobile Future
Feed URL: http://www.jroller.com/shareme/feed/entries/rss
Feed Description: A Weblog about Java programming and digital convergence on mobile devices in such areas as P2P and collaborative technology.
One of the challenges in the mobile space is who do you handle the failure points caused by a web app system in which parts of the facades are in different languages such as javascript, html, and css. The answer might be to set up a javascript collection of functions that act as Finite State Machine. Instead of the DSL vocab being in XML which is somewhat ugly you use the fact that javascript allowos chaining of methods and have a chain of methods represent a state.
This seems to work well in the Webkit WebView environment as teh first part or the show action part is normally the CSS DOM part with the when part specifying the object we are examining for the state to trigger the show action. You could even group said DSL rule collections per html page/screen. Because the language is in javascript and DOM terms you can than have emerging behavior that comes directly form the application metadata.
The side benefit is on mobile platforms where applications cannot run in background such as iPhone we can save the states and have application resume from previous state upon new relaunch.