Refactored sheerka class: splitted to use sub handlers. Refactored unit tests to use classes.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# How to serialize ?
|
||||
|
||||
## General rule
|
||||
- 1 byte : type of object code
|
||||
- int : version of the encoder
|
||||
- data : can be the json representation of the object
|
||||
|
||||
### Current supported types
|
||||
- E : events
|
||||
- J : Json object (with history management)
|
||||
- P : pickle (no history)
|
||||
- S : state (history, but not managed by the serializer )
|
||||
- C : concept (with history management)
|
||||
- D : concept definitions (no history management)
|
||||
- R : executionContext ('R' stands for Result or ReturnValue, no history management)
|
||||
|
||||
## How concepts are serialized ?
|
||||
- get the id of the concept
|
||||
- get the hash of the concept −> it will be its unique key
|
||||
structure of the serialisation:
|
||||
```json
|
||||
{
|
||||
"id" : "id",
|
||||
"parent": <hash code of the previous version of the concept> or "",
|
||||
"name": <name of the concept>,
|
||||
"where": "",
|
||||
"pre": "",
|
||||
"post": "",
|
||||
"body": "",
|
||||
"desc": "",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
## Idea to manage ObjectSerializer
|
||||
Problem:
|
||||
During serialization, there is no issue. The match() method is the unique way to get the correct serialier.
|
||||
During the deserialisation, all Object serializer have type = '0' and version = 1.
|
||||
So how to choose the correct one ?
|
||||
A possible solution will be to add the type of the object to deserialize to the saved stream
|
||||
--> SHA256 for every object. Too much data saved.
|
||||
The id is to let to inc the version automatically in the Serialiser (during the registration) and to keep the mapping within sdp.state
|
||||
|
||||
Reference in New Issue
Block a user