Skip to content

Commit 702fd49

Browse files
authored
Merge pull request mendix#6152 from Robinfr/ufc/state-handling
Add new info on state handling
2 parents 5e94a8c + aa637d0 commit 702fd49

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

content/en/docs/refguide/runtime/mendix-client.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ These are functions of the environment in which the Mendix Client is running. In
7070

7171
This is the static data which is needed by the Mendix Client. For a browser-based client, this data is held online, with the Runtime Server. For native mobile apps, this is held locally on the device.
7272

73-
These include the initial environment (for example, the browser shell page) needed to start the Mendix Client, Cascading Style Sheets (css files) which define the app’s theme, and JavaScript files which define client-side logic.
73+
These include the initial environment (for example, the browser shell page) needed to start the Mendix Client, Cascading Style Sheets (CSS files) which define the app’s theme, and JavaScript files which define client-side logic.
7474

7575
### 2.9 Data API
7676

@@ -96,7 +96,17 @@ For more information about the communication between the Mendix Client and the R
9696

9797
This communicates the current state of the app (held in the object cache) to the Runtime Server. As the state is held in the Mendix Client, the Runtime Server can be stateless. This ensures that it is easier to scale your app horizontally by adding more instances as any instance can handle any request.
9898

99-
To avoid performance issues, the Mendix Client does not send the entire state to the runtime. State handling decides which parts of the state should be sent by analyzing the model during the deployment of the applications.
99+
To avoid performance issues, the Mendix Client does not send the entire state to the runtime. State handling decides which parts of the state should be sent by analyzing the model during the deployment of the applications. This analysis consists of two parts.
100+
101+
Firstly, during deployment, all microflows “reachable” from the client are analyzed. For example:
102+
103+
* Event handlers of entities
104+
* Microflows called from a nanoflow
105+
* Microflows called from the page
106+
107+
This analysis is done based on the microflow parameters and their usages throughout the microflow. Any time an association is used in the microflow, the association is marked, and will also be sent in the request if needed. In some cases, such as Java actions, the analysis is not done as it would be too performance heavy. In that case, all objects associated with the microflow parameters will be sent along.
108+
109+
Secondly, for other (non-microflow) actions such as committing or deleting objects, a simpler analysis is performed on the client side to determine which associations should be included in the request.
100110

101111
For more detailed information about state, see this blog: [https://www.mendix.com/blog/the-art-of-state-part-1-introduction-to-the-client-state/](https://www.mendix.com/blog/the-art-of-state-part-1-introduction-to-the-client-state/). This also includes a worked example where you can see, and duplicate for yourself, how state is passed to the Runtime Server.
102112

@@ -200,7 +210,7 @@ When the app is deployed, the static resources are placed in a structure referre
200210

201211
* index.html – the initial HTML page which is loaded when the end-user starts the Mendix Client — this contains the client configuration and other static non-Mendix content (for example if Google analytics is added to the app)
202212
* mxui.js – the main Mendix Client code
203-
* app styling/Atlas – the app-specific css styling and static visual elements which define how a page is displayed
213+
* app styling/Atlas – the app-specific CSS styling and static visual elements which define how a page is displayed
204214
* widgets – both native and web core widgets which are used by this app
205215
* page definitions – xml page definitions which tell the Mendix Client what the pages for this app look like
206216

content/en/docs/refguide9/runtime/mendix-client.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ These are functions of the environment in which the Mendix Client is running. In
7272

7373
This is the static data which is needed by the Mendix Client. For a browser-based client, this data is held online, with the Runtime Server. For native mobile apps, this is held locally on the device.
7474

75-
These include the initial environment (for example, the browser shell page) needed to start the Mendix Client, Cascading Style Sheets (css files) which define the app’s theme, and JavaScript files which define client-side logic.
75+
These include the initial environment (for example, the browser shell page) needed to start the Mendix Client, Cascading Style Sheets (CSS files) which define the app’s theme, and JavaScript files which define client-side logic.
7676

7777
### 2.9 Data API
7878

@@ -98,7 +98,17 @@ For more information about the communication between the Mendix Client and the R
9898

9999
This communicates the current state of the app (held in the object cache) to the Runtime Server. As the state is held in the Mendix Client, the Runtime Server can be stateless. This ensures that it is easier to scale your app horizontally by adding more instances as any instance can handle any request.
100100

101-
To avoid performance issues, the Mendix Client does not send the entire state to the runtime. State handling decides which parts of the state should be sent by analyzing the model during the deployment of the applications.
101+
To avoid performance issues, the Mendix Client does not send the entire state to the runtime. State handling decides which parts of the state should be sent by analyzing the model during the deployment of the applications. This analysis consists of two parts.
102+
103+
Firstly, during deployment, all microflows “reachable” from the client are analyzed. For example:
104+
105+
* Event handlers of entities
106+
* Microflows called from a nanoflow
107+
* Microflows called from the page
108+
109+
This analysis is done based on the microflow parameters and their usages throughout the microflow. Any time an association is used in the microflow, the association is marked, and will also be sent in the request if needed. In some cases, such as Java actions, the analysis is not done as it would be too performance heavy. In that case, all objects associated with the microflow parameters will be sent along.
110+
111+
Secondly, for other (non-microflow) actions such as committing or deleting objects, a simpler analysis is performed on the client side to determine which associations should be included in the request.
102112

103113
For more detailed information about state, see this blog: [https://www.mendix.com/blog/the-art-of-state-part-1-introduction-to-the-client-state/](https://www.mendix.com/blog/the-art-of-state-part-1-introduction-to-the-client-state/). This also includes a worked example where you can see, and duplicate for yourself, how state is passed to the Runtime Server.
104114

@@ -202,7 +212,7 @@ When the app is deployed, the static resources are placed in a structure referre
202212

203213
* index.html – the initial HTML page which is loaded when the end-user starts the Mendix Client — this contains the client configuration and other static non-Mendix content (for example if Google analytics is added to the app)
204214
* mxui.js – the main Mendix Client code
205-
* app styling/Atlas – the app-specific css styling and static visual elements which define how a page is displayed
215+
* app styling/Atlas – the app-specific CSS styling and static visual elements which define how a page is displayed
206216
* widgets – both native and web core widgets which are used by this app
207217
* page definitions – xml page definitions which tell the Mendix Client what the pages for this app look like
208218

0 commit comments

Comments
 (0)