Stateless vs Stateful

前端 未结 8 1320
暖寄归人
暖寄归人 2020-11-28 18:31

I\'m interested in articles which have some concrete information about stateless and stateful design in programming. I\'m interested because I want to learn more about it, b

相关标签:
8条回答
  • 2020-11-28 18:59

    A stateful app is one that stores information about what has happened or changed since it started running. Any public info about what "mode" it is in, or how many records is has processed, or whatever, makes it stateful.

    Stateless apps don't expose any of that information. They give the same response to the same request, function or method call, every time. HTTP is stateless in its raw form - if you do a GET to a particular URL, you get (theoretically) the same response every time. The exception of course is when we start adding statefulness on top, e.g. with ASP.NET web apps :) But if you think of a static website with only HTML files and images, you'll know what I mean.

    0 讨论(0)
  • 2020-11-28 19:02

    I had the same doubt about stateful v/s stateless class design and did some research. Just completed and my findings has been posted in my blog

    • Entity classes needs to be stateful
    • The helper / worker classes should not be stateful.
    0 讨论(0)
提交回复
热议问题