WS-REST 2011
Second International Workshop on RESTful Design
Chairs: Cesare Pautasso, Erik Wilde, Rosa Alarcon
<br>
Keynote: Stuart Charlton
I'll See You on the Write Side of the Web
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Ā
I'll See You on the Write Side of the Web
1. I'll See You on
the Write Side of the Web
WS-REST 2011
1
2. Introduction
ā¢ Stuart Charlton (@svrc)
ā¢ Director at Canadian Paciļ¬c Railway
ā¢ Formerly CTO of Elastra, a cloud computing product
based on semantic web technology
ā¢ Weblog: Stu Says Stuff
http://www.stucharlton.com/blog
ā¢ Many thanks to commenters and twitterers on this
topic
2
3. Theme
ā¢ The Web Architecture has been an immense
success...
ā¢ ... and yet, we can do better.
ā¢ Thereās a need to design the software for the
write side of the web to scale and become
nearly as serendipitous as the read side
ā¢ Is this even possible? Letās ļ¬nd out.
3
4. The Read Side
ā¢ GET ā¢ Atom & RSS feeds
ā¢ RDFa/Microformats ā¢ Search
ā¢ Browsing ā¢ Semantic Web
4
5. The Write Side
ā¢ POST ā¢ Facebook Status
ā¢ AtomPub ā¢ Media Sharing
ā¢ Integration ā¢ e-Commerce
5
8. Why?
ā¢ Systems Integration
ā¢ Custom media types are the current approach...
ā¢ ... but that can only be a transitory solution
ā¢ Many āRESTfulā design thrashing due to lack of
prescriptive guidance
ā¢ Would be reduced with more generic media
types (e.g. as with HTML, AtomPub)
8
9. Why?
ā¢ REST is not CRUD (create, read, update, delete)
ā¢ Neither is HTTP
ā¢ POST does not map directly to ācreateā
ā¢ CRUD leads to complexity at scale
9
10. Why?
ā¢ Programming models matter
ā¢ In particular, the clientŹ¼s model of how it interacts
with the server
ā¢ Process-driven? Or something else?
ā¢ Lots of innovation in this space...
10
11. Theses
ā¢ The Web architectureās core strength is in encouraging small
pieces of independent agreement to be linked together and
shared; weāre missing some agreements for writes
ā¢ The Web architecture encourages clients to be designed as
agents in a dynamic information space
ā¢ There are practical approaches to programming agents in a
dynamic environment
ā¢ It should be possible to create a general purpose media
type for systems to manipulate state on the web, in lieu of
more speciļ¬c media types.
11
13. Collaborative Systems
Architecture
ā¢ āThe greatest leverage in system architecting is at the
interfaces. The greatest dangers are also at the interfaces.ā
ā¢ āWhen the components of a system are highly independent,
operationally and managerially, the architecture of the system
is the interfaces.ā
(Maier & Rechtin, The Art of Systems Architecting)
ā¢ In Roy Speak....
ā¢ ā[RESTās goals are] achieved by placing constraints on
connector semantics where other styles have focused on
components semantics.ā
13
14. Design for Serendipity
ā¢ āChance encountersā
ā¢ Media types, link relations,
RDFa/microformats, URI templates,
well-known URIs, host meta, etc.
14
15. What agreements could be helpful?
ā¢ Link relations for POST resources
ā¢ The effects of a POST
ā¢ cache invalidation
ā¢ pre/post conditions
ā¢ The contents of a POST
ā¢ e.g. RDF Forms
15
17. Client/Server Programming
Invoke Remote
Procedure
Create
Application Request
Logic & Message
Exception Format
Handling New Message Handler
(optional)
Handler
New Message
Response
Message
Format
Client Server
17
18. REST Raises the Level of Abstraction
ā¢ The message vs. the resource/representation
ā¢ Traditional Client/Server:
Client is a program sending/receiving messages
ā¢ REST:
Client is an agent acting in an information space
18
19. Hypermedia Programming
Cached HTTP GET
Representations Sensors Resource
Goals & State of the
Preferences application now Resource
Resource
Representation
Logic
Modify Choose Resource
e.g. Link relations,
Goals Desired State
Media type
speciļ¬cations,
pre/post conditions
Exception Transfer Desired
Handlers State
Runtime Events
Effectors Resource
HTTP POST
Environment
Hypermedia Agent (The Web)
19
20. Qualities of the Client
ā¢ Goal-Directed
ā¢ Reactive
ā¢ Hypermedia workspace
(cached representations)
ā¢ Sensing can be done to pick up on effects
20
22. Agent
ā¢ Traditional agents are distinguished from
mere programs via...
ā¢ The existence of an environment it needs
to react to
ā¢ The autonomy for the agent to make
detailed decisions for the user so long as it
is seeking to achieve a goal
22
23. The AI approach to Agents
ā¢ Automated Planning
ā¢ A process to determine an order of actions to be
taken in pursuit of a goal
Current state of the world
Description of actions Planner Required actions (plan)
Goals and constraints
23
24. Example of Planning
Download package list
Install Z
Download X
Upgrade Z
Install X
Download Y Download X
Download Z
Upgrade X
Download package list Install Y
Download Y
Install X Install Y
Upgrade Y Install X
Plan
Set of all available actions (selected and
ordered actions)
24
25. Step 1 Step 2 Step n Result
15 /32
An Alternative Approach
ā¢ Subsumption Architecture;
aka. Hierarchical State Machines
Development by subsumption
Situation n STAGE n !"
ā¦ā¦ā¦
ā¦
SYSTEM
Situation 2 STAGE 2 !" STAGE 2 !"
Situation 1 STAGE 1 !" STAGE 1 !" STAGE 1
!"
0 time
Step 1 Step 2 ā¦ Step n Result
15 /32
25
26. Programming by
Difference
ā¢ Coined by Miro Samek
ā¢ State nesting lets you deļ¬ne a new state
rapidly in terms of an old one, by reusing
semantics from the parent
ā¢ Reuse what is common, override what is not
26
32. Possible Characteristics
ā¢ JSON-based (and/or JS code on demand)
ā¢ Link relations for states, events, and
transitions
ā¢ Events become identiļ¬able elements of some
representations
32
33. Behave: A JavaScript
State-Aware User Agent
ā¢ Implemented in node.js
ā¢ JSON-based linked state machines
ā¢ First release in May 2011
33
34. Revisiting the Theses
ā¢ Agreements: The effects of a POST in context to other
representations
ā¢ Programming: Instead of a RESTful client library, aim for
an agent runtime
ā¢ Agents: Hierarchical state machines are promising
today; hierarchical planning with sensing is a promising
thread for research
ā¢ Media Type: Link relations for states and their transitions;
the ability to nest states & transitions via hyperlinks
34