Skip to content

Commit 9b63d10

Browse files
authored
Update README.md
1 parent bbcf0ad commit 9b63d10

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ This project is just an attempt to implement a feature to serialize objects (per
88

99
### How to get universal serialization feature in your classes
1010

11-
To get the full features, you just have to import in your system 4 classes (1) : _OPNLib.Serialize.Adaptor, OPNLib.Serialize.Util and OPNLib.Serialize.TemplateOPNLib.Serialize.TemplateCSV_.
11+
To get the full features, you just have to import in your system 4 classes (1) : `OPNLib.Serialize.Adaptor`, `OPNLib.Serialize.Util`, `OPNLib.Serialize.TemplateOPNLib.Serialize.Template` and `OPNLib.Serialize.TemplateOPNLib.Serialize.TemplateCSV` (this last one it's not yet finished in Release 1/2018-04).
1212

13-
(1) Actually you would just need _OPNLib.Serialize.Adaptor_ if you just need JSON serialization
13+
(1) Actually you would just need `OPNLib.Serialize.Adaptor` if you just need JSON serialization
1414

1515
### Start Serializing
1616

17-
To enable this feature for a class, that class has to extend from _OPNLib.Serialize.Adaptor_. That'll be the only time that you'll have to touch your class for this feature. After that moment your class will be able to export/import JSON objects and it will accept future serialization mechanisms that you decide to implement without having to make more changes to class definition.
17+
To enable this feature for a class, that class has to extend from `OPNLib.Serialize.Adaptor`. That'll be the only time that you'll have to touch your class for this feature. After that moment your class will be able to export/import JSON objects and it will accept future serialization mechanisms that you decide to implement without having to make more changes to class definition.
1818

1919
---
2020

@@ -82,6 +82,20 @@ During map generation, by default, the `Adaptor` sets export and import conversi
8282

8383
---
8484

85+
This is an example of two nodes in global `^MAPS` and their counterpart in `^MAPSREV`:
86+
```
87+
...
88+
...
89+
^MAPS("SampleApps.Serialize.MapTesting","MAP0",4,"reference")=$lb("referencia","","1","SampleApps.Serialize.MapTesting","","")
90+
^MAPS("SampleApps.Serialize.MapTesting","MAP0",5,"arrayOfObjects")=$lb("arrayDeObjectos","","1","SampleApps.Serialize.MapTesting","","")
91+
...
92+
...
93+
^MAPSREV("SampleApps.Serialize.MapTesting","MAP0",4,"referencia")=$lb("reference","","1","SampleApps.Serialize.MapTesting","","")
94+
^MAPSREV("SampleApps.Serialize.MapTesting","MAP0",5,"arrayDeObjetos")=$lb("arrayOfObjects","","1","SampleApps.Serialize.MapTesting","","")
95+
...
96+
...
97+
```
98+
8599
### How could we configure our mapping for serialization?
86100

87101
We can have as much mapping definitions for a class as we need. An easy way to start to define our customized maps is exporting the default `MAP0` and importing it again with a different name, then we can make changes in the map regarding the properties that should be exported /imported, names, conversor methods to apply. To do this, we can modify directly in the global, or do it programatically (See `OPNLib.Serialize.Util` class for tools to export/import maps, get / set property mappings,etc…)

0 commit comments

Comments
 (0)