Index
Example
Stateful Model
Stateless Model
Web Request With Stateful Model
Web Request With Stateless Model
Example
Let's figure out these important terms called
"stateful"
and
"stateless"
.
For a simple example where we have a Car (purchase). We need to be able to compute
totalPrice = stickerPrice - discount
📋
Stateful Model
A
"stateful"
model is
dependent
on other state (data) to compute total price.
The "discount" is
not
part of the model. Is is external to the model.
It can
not
independently compute the total price.
Stateless Model
A
"stateless"
model is
independent
(self-described).
It can independently compute the total price.
Web Request With Stateful Model
What would be a weakness of receiving a
stateful model
as as part of a web request?
Show Answer
The stateful model would be
missing
important information. It could not calculate.
In other words the request is incomplete -- we have a mess.
Web Request With Stateless Model
Would a
stateless model
solve the problem we encountered with the
stateful model
?
Everything we need is in the request.
Show Answer
Yes indeed.
The stateless model does not need
other
state/data.
Coding Fundamentals (Chapter 501 - Concepts)
Chapter 501 - Concepts
Stateful and Stateless Web Services
Search Site
Home
Back To Top