give it a rest already arnon rotem-gal-oz vp r&d xsights
TRANSCRIPT
Give it a REST already
Arnon Rotem-Gal-OzVP R&D xsights
www.xsights.comwww.rgoarchitects.com/nblog
SomeTheory
Making sense of the terminology soup
Code/Detailed Design
Design
Design Patterns Architecture
Architectural PatternsArchitectural Styles
SOA vs. RESTPipes and
FiltersClient Server
Uniform Interface
Virtual Machine
DistributedAgents
LayeredSystem
Replicated Repository
Code OnDemand
StatelessComm. Cacheable
RESTSOA
REST = "Representation State Transfer"
Dispatcher
WebApp
Cache(Resource)
Put (New State in XML)
OK
Get (Latest State)
Representation(JSON)
Layers should have some constraints on communications
Layer?
Layer?
Layer?
Layer?
Layer
Layers should have some constraints on communications
Component
Component
Layer
Componet
Client/Server
Client Server
Capabilities (services)Requests initiator
Request
Reply
Replicated Repository is about having
more than one copy providing
the same service looks like one copy
better performance and latency
copy
copy
copy
copy
copy
copy
copy
copy
copy
The uniform interface
Document Centric messages provide
the client with the needed state
and allow stateless
communications
REST also externalize state transitions
Use IDs that are linkse.g. a
Technology Mapping
HTTP is the most common REST implementation
But you can create others
Waka canoe
GET = query/read a resource for a representation
PUT = create with ID set by the
client / replace
POST = Create a subordinate resource with ID set by server / update
DELETE= remove the URI (most likely delete the resource)
HEAD = GET but only retrieves
metadata (headers)
OPTIONS – The currently available
verbs / requirements for communication
Why REST?
Example – Resource Manager
http://devrig:52141/RM/Sessions/abc/
• ATOMPUB– Session details• URI (ID)• State (start/end/status etc.)• Resources
– Knows status– URI for the Resource representation on the RM– URI for the Resource itself
Common REST misconceptions
REST = CRUD
REST is the ultimate architecture
REST = HTTP
REST will automagically make you write perfect distributed systems
REST is Simpler