Formal Modeling of RESTful Systems Formal Modeling of RESTful Systems Using Finite-State Machines Using Finite-State Machines Ivan Zuzak, Ivan Budiselic, Goran Delac School of Electrical Engineering and Computing, University of Zagreb, Zagreb, Croatia
63
Embed
Formal Modeling of RESTful Systems Using Finite-State …ivanzuzak.info/papers/2011_REST_slides.pdfJune 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 9/63
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Formal Modeling of RESTful Systems Formal Modeling of RESTful Systems Using Finite-State MachinesUsing Finite-State Machines
Ivan Zuzak, Ivan Budiselic, Goran DelacSchool of Electrical Engineering and Computing, University of Zagreb, Zagreb, Croatia
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 2/63
Ivan Zuzak
● Ph.D student, University of Zagreb● Consumer Computing Laboratory
● Foundation of (a part of) the World Wide Web architecture
● HTTP, URI, HTML
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 5/63
Importance of Understanding REST
● Understanding and evolving the WWW● The WWW has grown in scale and complexity● Where are we now and where should we go?
● Applying REST to other domains● WWW is only one instance of REST● Can REST be applied to other domains? How?
● Engineering● Understanding is the basis for doing and doing well● Software frameworks, tools, …
Real-Time Web
RESTdiscuss
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 6/63
Problems with Understanding REST
● Lack of simple and operational formal models
● Existing models
● Semi-formal diagrams and natural language descriptions ● Formal models of hypermedia systems (not REST)● Models focused on the WWW (not REST)● Separate client and server● Static, non-operational● Misuse of terminology
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 7/63
Research Goal – Formalism for Modeling RESTful Systems
● Any RESTful system● The WWW is a guide, not a judge
● System as a whole ● Integrated view of both the client and server operation (the application)
● Operational● Both the static and dynamic view of operation
● Simple, understandable by researchers and engineers● “Use the least powerful language suitable for expressing information,
constraints or programs on the World Wide Web.”, 2006, W3C TAG
● Use established concepts and terminology● Dr. Fielding's thesis
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 8/63
REST Principles 101
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 9/63
REST Principles 101
● Layered client-server
Cacheable
Stateless
Code-on-demand
Uniform interface
Identification of resources
Manipulation of resources through representations
Self-descriptive messagesMethods, link types, media types, …
Hypermedia as the engine of application state
Links
User
agen
tIn
terme d
iariesO
rigin
server
Req Resp
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 10/63
REST Principles 101
● Layered client-server
● Cacheable
Stateless
Code-on-demand
Uniform interface
Identification of resources
Manipulation of resources through representations
Self-descriptive messagesMethods, link types, media types, …
Hypermedia as the engine of application state
Links
User
agen
tIn
terme d
iariesO
rigin
server
Cache
Cache
Cache
Req Resp
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 11/63
REST Principles 101
● Layered client-server
● Cacheable
● Stateless
Code-on-demand
Uniform interface
Identification of resources
Manipulation of resources through representations
Self-descriptive messagesMethods, link types, media types, …
Hypermedia as the engine of application state
Links
User
agen
tIn
terme d
iariesO
rigin
server
Cache
Cache
Cache
Appstate
Req Resp
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 12/63
REST Principles 101
● Layered client-server
● Cacheable
● Stateless
● Code-on-demand
Uniform interface
Identification of resources
Manipulation of resources through representations
Self-descriptive messagesMethods, link types, media types, …
Hypermedia as the engine of application state
Links
User
agen
tIn
terme d
iariesO
rigin
server
Cache
Cache
Cache
Appstate
Req Resp
COD engine
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 13/63
REST Principles 101
● Layered client-server
● Cacheable
● Stateless
● Code-on-demand
● Uniform interface● Identification of resources
● Manipulation of resources through representations
Self-descriptive messagesMethods, link types, media types, …
Hypermedia as the engine of application state
Links
User
agen
tIn
terme d
iariesO
rigin
server
Cache
Cache
Cache
Appstate
ResResRes
Req Resp
COD engine
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 14/63
REST Principles 101
● Layered client-server
● Cacheable
● Stateless
● Code-on-demand
● Uniform interface● Identification of resources
● Manipulation of resources through representations
● Self-descriptive messages
– Operations, media types, metadata …
Hypermedia as the engine of application state
Links
User
agen
tIn
terme d
iariesO
rigin
server
Cache
Cache
Cache
Appstate
ResResRes
Req Resp
MessageprocessorMessage
processor
Messageprocessor
Messageprocessor
COD engine
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 15/63
REST Principles 101
● Layered client-server
● Cacheable
● Stateless
● Code-on-demand
● Uniform interface● Identification of resources
● Manipulation of resources through representations
● Self-descriptive messages
– Operations, media types, metadata …
● Hypermedia as the engine of application state
– Links
User
agen
tIn
terme d
iariesO
rigin
server
Cache
Cache
Cache
Appstate
ResResRes
Req Resp
MessageprocessorMessage
processor
Messageprocessor
Messageprocessor
COD engine
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 16/63
Finite State Machines
● ε-NFA formalism
Nondeterministic
Epsilon transitions
States × (Inputs U ε) → P(State)
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 17/63
Finite State Machines
● ε-NFA formalism
● Finite state machine
Nondeterministic
Epsilon transitions
States × (Inputs U ε) → P(State)
S0
S1
S2
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 18/63
Finite State Machines
● ε-NFA formalism
● Finite state machine
Nondeterministic
Epsilon transitions
States × (Inputs U ε) → P(State)
S0
S1
S2
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 19/63
Finite State Machines
● ε-NFA formalism
● Finite state machine
Nondeterministic
Epsilon transitions
States × (Inputs U ε) → P(State)
S0
S1
S2
a
b
a
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 20/63
Finite State Machines
● ε-NFA formalism
● Finite state machine
Nondeterministic
Epsilon transitions
States × (Inputs U ε) → P(State)
S0
S1
S2S2
a
b
a
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 21/63
Finite State Machines
● ε-NFA formalism
● Finite state machine● Nondeterministic
Epsilon transitions
States × (Inputs U ε) → P(State)
S0
S1
S2S2
a
a
b
a
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 22/63
Finite State Machines
● ε-NFA formalism
● Finite state machine● Nondeterministic● Epsilon transitions
States × (Inputs U ε) → P(State)
S0
S1
S2S2
a
a
b
a
ε
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 23/63
Finite State Machines
● ε-NFA formalism
● Finite state machine● Nondeterministic● Epsilon transitions● Transition Function:
States × (Inputs U ε) → P(States)
S0
S1
S2S2
a
a
b
a
ε
Power set!
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 24/63
Finite State Machines
● ε-NFA formalism
● Finite state machine● Nondeterministic● Epsilon transitions● Transition Function:
States × (Inputs U ε) → P(States)
S0
S1
S2S2
● System level view
Nondeterministism
Transition function returns any state from a set, not known in advance which one
a
a
b
a
ε
InputSymbol
Generator
InputSymbol
Generator
CurrentState
CurrentState
TransitionFunction
TransitionFunction(1)
(2)
(2)
(3)
Power set!
June 22, 2011 Formal Modeling of RESTful Systems Using Finite-State Machines 25/63