New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support generic custom serialization #618

Closed
s-ludwig opened this Issue Apr 14, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@s-ludwig
Member

s-ludwig commented Apr 14, 2014

Currently there are three ways to customize how a type gets serialized: toString/fromString, toJson/fromJson and toBson/fromBson

It would be nice to have a way to customize the result without using a specialized output format. An idea could be to support arbitrary T serialize() and deserialize(T) methods, where T is the representation type that gets serialized.

See also #617

@UplinkCoder

This comment has been minimized.

Show comment
Hide comment
@UplinkCoder

UplinkCoder Apr 14, 2014

Contributor

We already have vibed.data.serialization.
It also implicitly defines a serialization interface.

Contributor

UplinkCoder commented Apr 14, 2014

We already have vibed.data.serialization.
It also implicitly defines a serialization interface.

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig May 16, 2014

Member

Implemented by 7d22466. Possibly there is still a better name than toSerializedValue.

@UplinkCoder, I think I just didn't express myself well. This not about serialization per se, but about defining a different representation of a value, that forms the basis for serialization.

Member

s-ludwig commented May 16, 2014

Implemented by 7d22466. Possibly there is still a better name than toSerializedValue.

@UplinkCoder, I think I just didn't express myself well. This not about serialization per se, but about defining a different representation of a value, that forms the basis for serialization.

@s-ludwig s-ludwig added this to the 0.7.20 milestone May 16, 2014

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig May 18, 2014

Member

Maybe a better name: toRepresentation

Member

s-ludwig commented May 18, 2014

Maybe a better name: toRepresentation

@s-ludwig s-ludwig closed this in afcb1f7 May 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment