Itemscript, a specification for RESTful JSON integration
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Itemscript, a specification for RESTful JSON integration

on

  • 1,479 views

a briefing on the Itemscript project and a demonstration of the Item Lens proof of concept.

a briefing on the Itemscript project and a demonstration of the Item Lens proof of concept.

Statistics

Views

Total Views
1,479
Views on SlideShare
1,475
Embed Views
4

Actions

Likes
3
Downloads
12
Comments
0

1 Embed 4

http://www.slideshare.net 4

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Itemscript, a specification for RESTful JSON integration Presentation Transcript

  • 1. Itemscript A declarative language based on JSON
  • 2. Vision Simple schema  data store application markup Applications from components De-couple technical details Lean development Business agility
  • 3. Itemscript is Declarative
      • Separates design ( what )  from construction  ( how )
        • Simple API
        • Lends itself to iterative development
        • Technical details are hidden
        • Controls are exposed
        • Swap components without breaking the API
  • 4.  
  • 5.  
  • 6. Itemscript Philosophy
      • Applications are multi-layered
      • Core is compiled code
      • Wrapped around that are configuration files
      • Wrapped around that are user settings    
      • Compiled settings are the hardest to change
      • Configuration files help, but only offer limited access
      • User settings are usually very limited
      • Applications should expose all useful settings
    Core Configuration User settings
  • 7. Itemscript is JSON
      • JSON is simple
      • JSON has widespread support
      • JSON is an ideal data-interchange language
  • 8. JSON easily maps to native objects
      • JSON Objects
      • Native objects & packages
      • Nested object graphs
      • Maps/hashes/dictionaries
      • Databases
      • Key-value stores
      • Cloud databases      
      • JSON Arrays
      • Lists/arrays/sets
      • Query results
  • 9. Extending JSON
      • Deal with more data than fits in memory
        • Databases
        • Queries
      • Handle references
      • Manage local and remote data
      • Handle identifiers
      • Support schemas
      • Manage persistence
      • Handle events
  • 10. Semantics
      • Itemscript Schema
    •      JSON Schema language        
      • Itemscript JAM   JSON Application Markup
  • 11. Itemscript schema Dog Type "com.example.petstore.SCHEMA" : { "Dog" : { "ID name" : "", "weight" : 0, "REQUIRED owner" : "", "breed" : "", "isFixed" : true, } } item of type Dog: "com.example.petstore.dogs.Bella" : { "TYPE" : "com.example.petstore.SCHEMA.Dog", "name" : "Bella", "weight" : 9.2, "owner" : "Vera", "breed" : "Cavalier King Charles", "isFixed" : true } http://itemscript.org/ItemscriptSchema.html
  • 12. Itemscript JAM {            "widget" : "GWT.Image",            "title" : "Itemscript Logo",            "width" : "100px",            "height" : "100px",            "url" : "./itemscript-logo.jpg"          }
  • 13.  
  • 14. Business agility
      • Lean development using declarations
        • Developer & user iterate together
        • Discover needs as you develop solutions
      • Iterate applications as requirements develop
        • Add elements & event handlers as you need them
        • Trade up as better options arrive
  • 15. Proof of Concept
      • Item Lens ( JAM animator )
        • rich web UI based on Google GWT
      • Item Store ( Column store )
        • persistence based on Apache Derby           
      • Item Hash (Model application)
        • item tracker built using Itemscript JAM
  • 16.  
  • 17. Itemscript execution Itemscript Item Lens Item Store Schema JAM Item Store Protocol SQL MQ Cache XML
  • 18. Itemscript Applications
      • “ Small pieces loosely joined”
      • a collection of Lego bricks
      • Compiled objects are managed in libraries, by type
      • All "wiring-up" is done using JSON declarations
      • No sharp distinction between
      • application-building,
      • configuration, or
      • user settings
    http://www. smallpieces .com
  • 19. How we built it
      • Build objects that can be configured using JSON.
      • Use semantics that describe the domain             widget, handler, page
            • ticket, priority, status
    • white 
      • For each object type, build a factory that trades JSON for an object instance.
      • For each class of object ( e.g. widget ), combine the factories into a foundry.
      • Factor out common code.
  • 20. Itemscript System
      • Each system has one "root" JSON object
        • Acts as shared in-memory database for your application.
        • Application configuration
        • Application state
      • You can load additional Items - hold as long as needed, natively-garbage-collected.
        • Load system and initial configuration
        • Load Item from remote datastore
        • Copy part of Item to current application state
        • Discard Item
  • 21. The Item
      • The smallest unit of transferrable data.
      • Guaranteed to be transmitted as a whole.
      • Guaranteed to be fully navigable locally/synchronously.      
      • Consists of a JSON Object, including nested other objects.
      • Metadata and data live together in the JSON Object.
      • _ prefix denotes metadata . _CONNECTION key tells you where this Item came from. _ID key gives you the GUID key for an Item.
      • _PARENT_ID key gives you the GUID key for a parent
  • 22. Item Lens applications
      • Application
        • a set of nested Widgets.
        • usually includes a PagePanel.
      • PagePanel shows the Pages that have been defined.
        • Each Page is a set of nested Widgets.
      • Popups are also a set of nested Widgets.
        • Dialog boxes
        • Error boxes  
  • 23. Item Lens bootstrap
      • Item Lens starts an application:
        • loads modules (using GWT module system),
        • modules register Foundries containing Factories, or register additional Factories in existing Foundries. e.g. WidgetFoundry  
      • Item Lens loads and stores the script file.
        • Reads script file for more definitions - widgets, pages, popups
        • stores them in the corresponding Foundry.  
      • Item Lens reads script file to build the application.  
  • 24. Item Store
      • The Item Store is a key-value store of Items.
      •  
      • Any Item can be the root of another key-value store.
        • May map to: database-table-row.
        • Or to: database-table-row-subTable-rowset.
      •  
      • Easily replaced with SQL tables, key/value stores
      •  
      • Maps Item Store namespace locations to connect to remote locations and services.
  • 25. Item Store
      • Item Store RPC
        • Simple data store
          • Get
          • Put
          • Remove
        • Simple proxy for the service provider
          • Connect services when your application is ready
          • Swap out services without changing applications
  • 26. Developing Itemscript applications
      • Client side
        • Wrap widgets and components in Itemscript
        • Wire up components to build interfaces
      • Server side
        • Declare Itemscript data types 
        • Assign types to locations
        • Connect locations to services
  • 27. Item Hash
      • Building the model application 
        • item hash use case
        • item hash design process
        • pulldown list example
        • date picker example
        • event example
        • adding a new field
        • adding a new event handler
  • 28. Item Hash Page Nesting
  • 29. New Case Page Nesting
  • 30. Editing the Form                   {                                &quot;widget&quot; : &quot;GWT.VerticalPanel&quot;,                                    &quot;contents&quot; : [                         {                           &quot;widget&quot; : &quot;GWT.Html&quot;,                           &quot;html&quot; : &quot;<small>Priority</small>&quot;                           &quot;id&quot; : &quot;Priority&quot;                         },                         {                          &quot;widget&quot; : &quot;GWT.ListBox&quot;,                          &quot;width&quot; : &quot;200px&quot;,                          &quot;height&quot; : &quot;20px&quot;                          &quot;data&quot; : &quot;ItemHash.db/priorities&quot;                         }                      ]                   }
  • 31. Item Lens &quot;Can I set the date picker to tomorrow?&quot;
  • 32. Changing the Date Picker What would the JSON look like? {      &quot;widget&quot; : &quot;ItemLens.DatePickerTextBox&quot;      &quot;width&quot; : &quot;200px&quot;,      &quot;height&quot; : &quot;25px&quot;,    &quot;date&quot; : &quot;tomorrow&quot; }
  • 33. Changing the Date Picker When the &quot;date&quot; declaration says &quot;tomorrow&quot;, what logic do we need to add? if (params.hasOptionalString( &quot;date&quot; )) {      String dateStr = params.getString( &quot;date&quot; );      if (dateStr.equalsIgnoreCase( &quot;tomorrow&quot; )) {          Date tomorrow = new Date( new              Date().getTime()+ DAY_AS_MILLISECONDS );          box.setValue(tomorrow);      } }
  • 34. Event Handling &quot;Let's make the login box pop up.&quot;
  • 35. Event Handling What would the JSON look like? {      &quot;widget&quot; : &quot;GWT.Html&quot;        &quot;cellHorizontalAlignment&quot; : &quot;right&quot;        &quot;html&quot; : &quot;<small><b>login</b></small>&quot;        &quot;clickHandlers&quot; : {          &quot;clickHandler&quot; : &quot;ItemLens.PopupPanelShowClickHandler&quot;,          &quot;popup&quot; : &quot;loginPrompt&quot;    } }
  • 36. Event Handling Implementing a &quot;clickHandler&quot;
      • Register a factory to create an action.
    Animating &quot;popup&quot; : &quot;loginPrompt&quot;
      • Read the &quot;loginPrompt&quot; object in &quot;popups&quot; section.
      • Parse loginPrompt for the parameter needed.
      • Build a popup widget.
  • 37. Event Handling &quot;popups&quot;: {     &quot;loginPrompt&quot; : {       &quot;widget&quot; : &quot;GWT.DialogBox&quot;,       &quot;id&quot; : &quot;Login&quot;,       &quot;title&quot; : &quot;user login&quot;,       &quot;showRelativeTo&quot; : &quot;searchbox&quot;,       &quot;width&quot; : &quot;100px&quot;,       &quot;cellHorizontalAlignment&quot; : &quot;center&quot;,       &quot;cellVerticalAlignment&quot; : &quot;bottom&quot;,       &quot;html&quot; : &quot;<strong>User Login</strong>&quot;,       &quot;autohide&quot; : false,       &quot;contents&quot; : {       &quot;widget&quot; : &quot;GWT.VerticalPanel&quot;,       &quot;cellSpacing&quot; : 5       &quot;contents&quot; : [                ...
  • 38. Adding Widget Libraries
    • GChart
    {   &quot;widget&quot; : &quot;GChart.Chart&quot; ,    &quot;canvas&quot; : true ,    &quot;chartHeight&quot; : 200,    &quot;chartWidth&quot; : 300,    &quot;chartTitle&quot; : &quot;&lt;h3&gt;2008 Sales by Pie    Flavor&lt;br&gt;(Puny Pies, Inc.) &lt;/h3&gt;&quot; ,    &quot;legendVisible&quot; : false ,    &quot;initialPieSliceOrientation&quot; : 0.425,    &quot;curves&quot; : [       {        &quot;symbol&quot; : &quot;pieSliceOptimalShading&quot; ,        &quot;modelWidth&quot; : 6,        &quot;backgroundColor&quot; : &quot;green&quot; ,        &quot;borderColor&quot; : &quot;white&quot; ,        &quot;height&quot; : 0,        &quot;fillSpacing&quot; : 0,        &quot;fillThickness&quot; : 3,        &quot;hoverText&quot; : &quot;Apple, 65%&quot; ,        &quot;pieSliceSize&quot; : 0.65,        &quot;points&quot; : [          {            &quot;point&quot; : &quot;5,5&quot; ,            &quot;annotationText&quot; : &quot;Apple&quot; ,            &quot;annotationLocation&quot; : &quot;outsidePieArc&quot;          }          ...
      • Designers learn a few new declarations, not a new API
      • Full demo at  http://tinyurl.com/gchartdemo
  • 39. Downloads
      • Item Lens
    •           AJAX using Google GWT
    •          Components from Google Maps, Gchart, GWT Widget library
      • Itemscript Core Libraries
    •          Convenient JSON library for Java & GWT applications
  • 40. What's Next?
      • Item Store
      • Itemscript schema validator
      • Declarative security model   
      • Hosted Service
      • Application exchange
  • 41. Working with Itemscript Project pages http://itemscript.org http://code.google.com/p/itemscript/ Twitter updates http://twitter.com/itemscript FAQ http://code.google.com/p/itemscript/wiki/itemscriptfaq