Skip to content

Commit

Permalink
Clarify state concepts in REST tutorial
Browse files Browse the repository at this point in the history
Refactored the description of states in REST applications to better differentiate between application state and resource state. Enhanced explanations to underscore the relationship between client-server interactions and to introduce the concept of network affordances in state transitions.
  • Loading branch information
koriym committed Oct 25, 2024
1 parent 9fd22b0 commit 55a616b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
13 changes: 10 additions & 3 deletions manuals/1.0/en/tutorial_rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@ State transition refers to a change from one state to another within a system. I
2. They can move "somewhere else" (possible state transition).
3. "How" to move is defined (transition method).

There are two important types of states in REST applications:
These three elements are the basics of a state transition system.

### Two States in REST

In addition to the states used in state transitions, REST has two important types of states:

1. **Application State**
- Represents the current location on the client (browser) side, expressed through URLs.
- Represents the client (browser) location, expressed as URLs

2. **Resource State**
- Represents the state of the data managed on the server side, which the client accesses.
- Represents the state of data managed on the server

The client accesses resource states by changing its application state, and
the server responds with both resource states and network affordances that describe possible state transitions.

### Basic Flow of State Transitions in REST Applications

Expand Down
13 changes: 10 additions & 3 deletions manuals/1.0/ja/tutorial_rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@ RESTアプリケーションは本質的に「状態遷移システム」です
2. そこから「どこかへ」移動できます(遷移可能な状態)
3. 「どうやって」移動するかが定義されています(遷移方法)

RESTアプリケーション2種類の重要な状態があります:
これら3つの要素が状態遷移システムの基本です。

### RESTの2つの状態

状態遷移で用いられる状態以外に、RESTには2種類の重要な状態があります:

1. **アプリケーション状態**
- クライアント(ブラウザ)側での現在の位置を示し、URLで表現されます
- クライアント(ブラウザ)側での現在の位置を示し、URLで表現されます

2. **リソース状態**
- サーバー側で管理されるデータの状態で、クライアントがアクセスする情報の内容です。
- サーバー側で管理されるデータの状態です

クライアントはアプリケーション状態の変更によってリソース状態にアクセスし、
サーバーはリソース状態とともに、次の状態への遷移情報(ネットワークアフォーダンス)も返します。

### RESTアプリケーションの状態遷移の基本的な流れ

Expand Down

0 comments on commit 55a616b

Please sign in to comment.