Deserialize/Serialize
in a simple but powerful way
What is deserialization about?
Its all about coverting a string to an object
• decode: (json, url-encoded, yaml, xml) => array
• denormalize: array => object
Where to use deserialization?
• Rest APIs
• Webapplication forms
But why not using JMS/Symfony?
• denormalize recursive structure within existing objects
Howto use the deserializer?
• define one mapping per class (explicit > implicit)
• 3 methods (getClass, getDenormalizationFactory,
getDenormalizationFieldMappings)
getDenormalizationFactory
getDenormalizationFieldMappings
What is serialization about?
Its all about coverting a object to a string
• normalize: object => array
• encode: array => (json, url-encoded, yaml, xml)
Where to use serialization?
• Rest(ful) APIs
But why not using JMS/Symfony?
• there is no link support
• have a consistent tool on de/serialize
Howto use the serializer?
• define one mapping per class (explicit > implicit)
• 4 methods (getClass, getNormalizationType,
getNormalizationFieldMappings,
getNormalizationEmbeddedFieldMappings,
getNormalizationLinkMappings)
getNormalizationType
getNormalizationFieldMappings
getNormalizationFieldMappingsgetNormalizationFieldMappings
getNormalizationEmbeddedFieldMappings
getNormalizationFieldMappingsgetNormalizationFieldMappings
getNormalizationLinkMappings
getNormalizationFieldMappings
Links
• https://github.com/chubbyphp/chubbyphp-deserialization
• https://github.com/chubbyphp/chubbyphp-serialization

chubbyphp de/serialization