Daniel Werner has submitted this change and it was merged. Change subject: Added documentation on serialization code usage ......................................................................
Added documentation on serialization code usage Change-Id: Ib7ce7b0bec28172051ab3212f62cc7b1e6f0bfcd --- M README.md 1 file changed, 16 insertions(+), 0 deletions(-) Approvals: Daniel Werner: Checked; Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index 58f421f..47beb19 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,22 @@ ); ``` +### Serialization and deserialization + +The Ask language objects can all be serialized to a generic format from which the objects can later +be reconstructed. This is done via a set of Serializers/Serializer implementing objects. These +objects turn for instance a Query object into a data structure containing only primitive types and +arrays. This data structure can thus be readily fed to json_enoce, serialize, or the like. The +process of reconstructing the objects from such a serialization is provided by objects implementing +the Deserializers/Deserializer interface. + +Serializers can be obtained via an instance of SerializerFactory and deserializers can be obtained +via an instance of DeserializerFactory. You are not allowed to construct these serializers and +deserializers directly yourself or to have any kind of knowledge of them (ie type hinting). These +objects are internal to the Ask library and might change name or structure at any time. All you +are allowed to know when calling $serializerFactory->newQuerySerializer() is that you get back +an instance of Serializers\Serializer. + ## Tests This library comes with a set up PHPUnit tests that cover all non-trivial code. You can run these -- To view, visit https://gerrit.wikimedia.org/r/73781 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib7ce7b0bec28172051ab3212f62cc7b1e6f0bfcd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Ask Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <[email protected]> Gerrit-Reviewer: Addshore <[email protected]> Gerrit-Reviewer: Daniel Werner <[email protected]> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
