From 3ad4911ba61b04a1e9627686d0877a308c90d6ea Mon Sep 17 00:00:00 2001 From: Kazuki Nakanishi Date: Fri, 23 Mar 2018 16:45:12 +0900 Subject: [PATCH] Updated Design: Persistable Context (markdown) --- Design:-Persistable-Context.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Design:-Persistable-Context.md b/Design:-Persistable-Context.md index d158d93..8d6c0f0 100644 --- a/Design:-Persistable-Context.md +++ b/Design:-Persistable-Context.md @@ -119,22 +119,22 @@ To support all of the above cases, when the imported flow contains a persistable 1. if the identifier is defined, use the context storage. 2. if the identifier is not defined but `default` identifier is defined, use the default context storage. > DCJ: In this case - what happens if the default doesn't support a feature (like 'run(...') ? We should warn at least if not exact match. ->> KN: Then we have no clue how to handle the instruction. So we should throw an exception. -3. if neither the identifier nor a `default` identifier are not defined, throw an exception. +>> KN: Then we have no clue how to handle the instruction. So we should throw an error. +3. if neither the identifier nor a `default` identifier are not defined, throw an error. > DCJ: Yes not running but ideally still able to edit/correct the error if possible. ->> KN: If a user does not specify `default` identifier, it means they declare that they want to receive an error instead of doing something. So I think that just throwing an exception with an appropriate error message would be fine. +>> KN: If a user does not specify `default` identifier, it means they declare that they want to receive an error instead of doing something. So I think that just throwing an error with an appropriate error message would be fine. >>> NOL: To be clear - this only applies if they have `contextStorage` in their settings, but no `default` config within it? >>>> KN: Yes, that's right. I've added a table below to clarify the conditions. 4. if the entire contextStorage section is missing in settings.js, use `memory` module (same as the current context). The table below shows the settting of `settings.js` for each case above. -| Case | `contextStorage` object in settings.js | appropriate identifier in `contextStorage` | `defualt` in `contextStorage` | -| ---- | --------- | --------- | -------- | -| 1 | Exists | Exists | Exists / Not exist| -| 2 | Exists | Not exist | Exists | -| 3 | Exists | Not exist | Not exist | -| 4 | Not exist | N/A | N/A | +| Case | `contextStorage` object in settings.js | appropriate identifier in `contextStorage` | `default` in `contextStorage` | Action | +| ---- | --------- | --------- | -------- | -------- | +| 1 | Exists | Exists | Exists / Not exist| Use the specified module | +| 2 | Exists | Not exist | Exists | Use the `default` module | +| 3 | Exists | Not exist | Not exist | Throw an error | +| 4 | Not exist | N/A | N/A | Use `memory` module | ## Executing plugin specific function Currently, `get` / `set` / `keys` is only methods to handle Context.