Updated Design: Persistable Context (markdown)

Kazuki Nakanishi 2018-03-23 16:45:12 +09:00
parent 4197caf60c
commit 3ad4911ba6
1 changed files with 9 additions and 9 deletions

@ -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.