神刀安全网

REST State Management

In this article, we will discuss the different State management principles for REST services

REST State Management

State Management means to preserve the state of a control, web page etc.HTTP is a stateless protocol by nature. So, State management is a mechanism to preserve state (i.e. state of a webpage, a control or an object etc.) between subsequent requests to server from one or more clients.

REST Service has 2 primary type of states.

  • Active
  • Passive

Active:

When the service is invoked or executed then it enters the Active state.

Further, in Active state, The service can have 2 states.

  • Stateful
  • Stateless

Passive:

When the service is not in use, it is in Passive state.

Stateful:

In this condition, the service is active and actively performing a task and processing data for that task.

Stateless:

In this condition, the service is active but not actively processing data for a task.

Further, when the service is stateful, it can process 3 type of data.

  • Session
  • Context
  • Business

Session:

Session data represents information associated with retaining a connection made between a program and its client program.Sessions are identified by a unique identifier that can be read by using the SessionID property.A session is considered active as long as requests continue to be made with the same SessionID value. If the time between requests for a particular session exceeds the specified time-out value in minutes, the session is considered expired. Requests made with an expired SessionID value result in a new session.

Context:

When the service is active,stateful and executing the main task of the service.If the logic is tied with workflow, then it is further divided to context data and context rules. Context rules are the rules for executing workflow.

Business:

When the service is active and stateful,the service can execute a business task by executing multiple services.

Thanks for visiting !!

© 2016,admin. All rights reserved.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » REST State Management

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮