oslo.serialization/oslo_serialization
Gevorg Davoian 7ac405ce65 Unified and simplified API for all serializers
This patch is a proposition to the oslo.serialization for making a
more convenient API. Let me explain briefly why the current library
isn't very convenient for its users. Imagine that a library user
want to implement a function having some (de-)serialization inside.
The user also wants to make serialization configurable through
an additional argument to the function (e.g. some id like "json",
"msgpack" etc.). One can achieve this behaviour by importing all
necessary serializers (an import per a serializer) and adding
some logic for selecting an appropriate serialization mechanism
depending on id. But what if some new serializer is added to the
oslo.serialization? Then all users of the library will have to make
changes in their code. It's not good, and I think it would be better
if all changes concerning serializers were in the oslo.serialization
library. Therefore I think it is a good idea to have a module which
will bring together all implemented serializers under a unified and
somewhat simplified (because in most cases default values for some
parameters are fine) object oriented API, so that future users of the
library will be able to get any available serializer by its id
(importing only one module). Also it is worth saying that the patch
doesn't affect already written code, so there won't be any problems
with the backward compatibility.

May be this implementation isn't the best one, but I hope
the community will appreciate the idea and propose possible
improvements.

Change-Id: Idb12666255a990dfc8f8ff6b43e941b3481b9c1c
2016-04-04 15:27:16 +03:00
..
serializer Unified and simplified API for all serializers 2016-04-04 15:27:16 +03:00
tests Remove fallback to simplejson in jsonutils 2016-01-12 13:53:47 -06:00
__init__.py Move files out of the namespace package 2015-01-05 15:40:06 -05:00
base64.py Use versionadded and versionchanged in doc 2015-10-15 14:38:50 +02:00
jsonutils.py Remove fallback to simplejson in jsonutils 2016-01-12 13:53:47 -06:00
msgpackutils.py msgpackutils: drop Python 2.6 support 2015-11-21 12:18:30 +08:00