SlideShare a Scribd company logo
Expressing UI in JSON
A PRODUCTIVE WORKFLOW FOR WEB APPS DEVELOPMENT
USING PUPPET INSTEAD OF REST API
Imagine a simple web app
Home New Invoice
Invoices
Name Quantity Price Total
Customer A 10 100 100
Invoices #1
100
Customer Name
Customer A
Add row Save changes Cancel changes Delete invoice
# Name Total
1 Customer A 100
2 Customer B 99
Usual web app UI workflow (thick client)
BUSINESS REQUIREMENTS
UI WIREFRAME
DEV DESIGNDEV DESIGN
SERVER-SIDE 

(C#, PHP, ETC)
CLIENT-SIDE
(HTML + JS)
APP
DECIDE ON REST REFINE THE VISUALS
Problems with REST API
REST API is a stateless representation of a resource (data, document,
application logic).
Devs try to make REST APIs future-proof, to fit every purpose.
Which encourages redundancy.
In result, REST APIs have too much data than the client app needs.
Which makes it slow.
Problems with changing of the REST API
The REST API is contract that needs to be satisfied on both ends.
• It requires a lot of glue code and testing.
• Application logic needs to be on both ends.
Requirement changes that change this contract cost a lot.
I am not saying that REST is bad, but it has its flaws if you want super
fast and super easy client side apps.
Starcounter web app UI workflow (Puppet)
BUSINESS REQUIREMENTS
UI WIREFRAME
DEV DESIGN
SERVER-SIDE 

(C#)
CLIENT-SIDE
(HTML)
APP
DECIDE ON JSON REFINE THE VISUALS
JSON
How Puppet works
Server-driven view-models
Client reflects the current state of the session
User changes are proposed to server
Server changes are pushed to client
JSON-PATCH & WEBSOCKET
JSON
More info on starcounter.io
Progressive development of the client
BEFORE THE WIREFRAME BECOMES THE APP
Progressive development of the client
BEFORE THE WIREFRAME BECOMES THE APP
WORKING SERVER CAN BE OPERATED USING
JSON-PATCH ENABLED JSON EDITOR ON THE CLIENT
Your JSON can be used before client is done
Present InvoiceDemo
1. using JSON-Patch without template (just starcounter-debug-aid)
2. progressively adding HTML template
What exactly can be modelled with JSON?
TYPE SAMPLE VALUE WHAT IT’S GOOD FOR
object {“MainMenu”:	{},	“PagesList”:	{},	“CurrentPage”:	{}} Nested UI regions
array {“PagesList”:	[{“Url”:	“/page1”,	“Label”:	“Page	1”}] Lists, tables, graphs
string “/page1” Text labels, most of the form fields, URLs
number 1,	1.00 Numeric values, buttons
boolean true,	false Checkboxes, buttons
null null Not used in Puppet at the moment
What do we use it for?
We are gathering practical examples in
github.com/StarcounterSamples/KitchenSink
Pull requests are welcome!
Starcounter data binding in JSON
1. All JSON-by-example properties are bound to .json.cs
2. Properties matching the data model are bound implicitly to the
data object
3. Advanced: Use “Bind” helper to bind setters/getters in .json.cs
Twitter: @starcounterdb, @warpech
Thanks! Try out Starcounter,
let us know your thoughts!
Follow us on
.io

More Related Content

What's hot (20)

PPTX
THE SCIENCE AND ART OF BACKWARDS COMPATIBILITY
Informatics Summit
 
PDF
Testing Web Services - QA or the Highway 2016
Steinn 'Stan' Jónsson
 
PDF
CDC Tests - Integration Tests cant be made simpler than this!
Ramya Authappan
 
PPTX
What Is Ajax
Wings Interactive
 
PPTX
How to Develop for Data Transformation with FME Server
Safe Software
 
PPTX
API Proxy Auto Discovery
Vince Soliza
 
PDF
Marrying angular rails
Volker Tietz
 
PDF
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
Sauce Labs
 
PPTX
Performance presentation
Hashem Khalifa
 
PDF
From ActiveRecord to EventSourcing
Emanuele DelBono
 
PPTX
Angular js- 1.X
Nitin Giri
 
PPTX
Radu vunvulea refactoring&code smells
Radu Vunvulea
 
PPTX
Building Modern Web Apps with AngularJS
Raveen Perera
 
PPTX
Web application with mule
Anirban Sen Chowdhary
 
PDF
TPSE Thailand 2015 - Rethinking Web with React and Flux
Jirat Kijlerdpornpailoj
 
PPTX
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
All Things Open
 
PPTX
Mule ESB - How to convert from Xml to Json in 5 minutes
Gennaro Spagnoli
 
PDF
Ruby loves DDD
Emanuele DelBono
 
PDF
Web service的自动化测试 soap ui的介绍
bqconf
 
PPTX
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
POSSCON
 
THE SCIENCE AND ART OF BACKWARDS COMPATIBILITY
Informatics Summit
 
Testing Web Services - QA or the Highway 2016
Steinn 'Stan' Jónsson
 
CDC Tests - Integration Tests cant be made simpler than this!
Ramya Authappan
 
What Is Ajax
Wings Interactive
 
How to Develop for Data Transformation with FME Server
Safe Software
 
API Proxy Auto Discovery
Vince Soliza
 
Marrying angular rails
Volker Tietz
 
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
Sauce Labs
 
Performance presentation
Hashem Khalifa
 
From ActiveRecord to EventSourcing
Emanuele DelBono
 
Angular js- 1.X
Nitin Giri
 
Radu vunvulea refactoring&code smells
Radu Vunvulea
 
Building Modern Web Apps with AngularJS
Raveen Perera
 
Web application with mule
Anirban Sen Chowdhary
 
TPSE Thailand 2015 - Rethinking Web with React and Flux
Jirat Kijlerdpornpailoj
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
All Things Open
 
Mule ESB - How to convert from Xml to Json in 5 minutes
Gennaro Spagnoli
 
Ruby loves DDD
Emanuele DelBono
 
Web service的自动化测试 soap ui的介绍
bqconf
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
POSSCON
 

Similar to Expressing your UI in JSON – plain, data binding, advanced data binding (20)

PDF
Thin client SPAs. Stream UI using web standards
Starcounter
 
PDF
Thin client SPAs? Stream UI using web standards (CodeNight)
Starcounter
 
PDF
The State of Puppet - Dan Bode
Puppet
 
PPT
State of the Union by Dan Bode Puppet Labs
buildacloud
 
PDF
Service workers are your best friends
Antonio Peric-Mazar
 
PDF
A year with progressive web apps! #DevConMU
Antonio Peric-Mazar
 
KEY
REST+JS - Codebits 2011
João Nelas
 
PDF
Modern UI Development With Node.js
Ryan Anklam
 
PPTX
RESTful web APIs (build, document, manage)
Cisco DevNet
 
PDF
A year with progressive web apps! #webinale
Antonio Peric-Mazar
 
PDF
PuppetConf 2016: Enjoying the Journey from Puppet 3.x to 4.x – Rob Nelson, AT&T
Puppet
 
PDF
From Web App Model Design to Production with Wakanda
Alexandre Morgaut
 
PDF
200,000 Lines Later: Our Journey to Manageable Puppet Code
David Danzilio
 
PPTX
PWA basics for developers
Filip Rakowski
 
PPTX
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Robert Nelson
 
PPTX
Progressive web apps
Suraj Kumar
 
PDF
20181023 progressive web_apps_are_here_sfcampua
Юлия Коваленко
 
PDF
Progressive Web Apps are here!
Antonio Peric-Mazar
 
PPTX
Web assembly with PWA
Shashank Sharma
 
PPTX
Generative Testing in Clojure
Alistair Roche
 
Thin client SPAs. Stream UI using web standards
Starcounter
 
Thin client SPAs? Stream UI using web standards (CodeNight)
Starcounter
 
The State of Puppet - Dan Bode
Puppet
 
State of the Union by Dan Bode Puppet Labs
buildacloud
 
Service workers are your best friends
Antonio Peric-Mazar
 
A year with progressive web apps! #DevConMU
Antonio Peric-Mazar
 
REST+JS - Codebits 2011
João Nelas
 
Modern UI Development With Node.js
Ryan Anklam
 
RESTful web APIs (build, document, manage)
Cisco DevNet
 
A year with progressive web apps! #webinale
Antonio Peric-Mazar
 
PuppetConf 2016: Enjoying the Journey from Puppet 3.x to 4.x – Rob Nelson, AT&T
Puppet
 
From Web App Model Design to Production with Wakanda
Alexandre Morgaut
 
200,000 Lines Later: Our Journey to Manageable Puppet Code
David Danzilio
 
PWA basics for developers
Filip Rakowski
 
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Robert Nelson
 
Progressive web apps
Suraj Kumar
 
20181023 progressive web_apps_are_here_sfcampua
Юлия Коваленко
 
Progressive Web Apps are here!
Antonio Peric-Mazar
 
Web assembly with PWA
Shashank Sharma
 
Generative Testing in Clojure
Alistair Roche
 
Ad

Recently uploaded (20)

PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Ad

Expressing your UI in JSON – plain, data binding, advanced data binding

  • 1. Expressing UI in JSON A PRODUCTIVE WORKFLOW FOR WEB APPS DEVELOPMENT USING PUPPET INSTEAD OF REST API
  • 2. Imagine a simple web app Home New Invoice Invoices Name Quantity Price Total Customer A 10 100 100 Invoices #1 100 Customer Name Customer A Add row Save changes Cancel changes Delete invoice # Name Total 1 Customer A 100 2 Customer B 99
  • 3. Usual web app UI workflow (thick client) BUSINESS REQUIREMENTS UI WIREFRAME DEV DESIGNDEV DESIGN SERVER-SIDE 
 (C#, PHP, ETC) CLIENT-SIDE (HTML + JS) APP DECIDE ON REST REFINE THE VISUALS
  • 4. Problems with REST API REST API is a stateless representation of a resource (data, document, application logic). Devs try to make REST APIs future-proof, to fit every purpose. Which encourages redundancy. In result, REST APIs have too much data than the client app needs. Which makes it slow.
  • 5. Problems with changing of the REST API The REST API is contract that needs to be satisfied on both ends. • It requires a lot of glue code and testing. • Application logic needs to be on both ends. Requirement changes that change this contract cost a lot. I am not saying that REST is bad, but it has its flaws if you want super fast and super easy client side apps.
  • 6. Starcounter web app UI workflow (Puppet) BUSINESS REQUIREMENTS UI WIREFRAME DEV DESIGN SERVER-SIDE 
 (C#) CLIENT-SIDE (HTML) APP DECIDE ON JSON REFINE THE VISUALS JSON
  • 7. How Puppet works Server-driven view-models Client reflects the current state of the session User changes are proposed to server Server changes are pushed to client JSON-PATCH & WEBSOCKET JSON More info on starcounter.io
  • 8. Progressive development of the client BEFORE THE WIREFRAME BECOMES THE APP
  • 9. Progressive development of the client BEFORE THE WIREFRAME BECOMES THE APP WORKING SERVER CAN BE OPERATED USING JSON-PATCH ENABLED JSON EDITOR ON THE CLIENT
  • 10. Your JSON can be used before client is done Present InvoiceDemo 1. using JSON-Patch without template (just starcounter-debug-aid) 2. progressively adding HTML template
  • 11. What exactly can be modelled with JSON? TYPE SAMPLE VALUE WHAT IT’S GOOD FOR object {“MainMenu”: {}, “PagesList”: {}, “CurrentPage”: {}} Nested UI regions array {“PagesList”: [{“Url”: “/page1”, “Label”: “Page 1”}] Lists, tables, graphs string “/page1” Text labels, most of the form fields, URLs number 1, 1.00 Numeric values, buttons boolean true, false Checkboxes, buttons null null Not used in Puppet at the moment
  • 12. What do we use it for? We are gathering practical examples in github.com/StarcounterSamples/KitchenSink Pull requests are welcome!
  • 13. Starcounter data binding in JSON 1. All JSON-by-example properties are bound to .json.cs 2. Properties matching the data model are bound implicitly to the data object 3. Advanced: Use “Bind” helper to bind setters/getters in .json.cs
  • 14. Twitter: @starcounterdb, @warpech Thanks! Try out Starcounter, let us know your thoughts! Follow us on .io