I am trying to learn OOPS by examples. So I try to implement a object serialiser.The object is same but it can be serialised to either XML, JSON etc. I see two types of suggestions out there.
In this blog, they say we can use visitor/double dispatch to serialise objects.
But, by definition we are building a serialised object from a complex object, so it make sense to create a XMLBuilder and JSONBuilder.
Now, which is the right way to do it ?
Aucun commentaire:
Enregistrer un commentaire