Skip to content
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

Provde some sort of NullType encoder #133

Open
cjnolet opened this issue Nov 3, 2014 · 3 comments
Open

Provde some sort of NullType encoder #133

cjnolet opened this issue Nov 3, 2014 · 3 comments

Comments

@cjnolet
Copy link
Member

cjnolet commented Nov 3, 2014

Thought I'm not advocating for allowing tuples to take on a Null value at any point- I think it would be useful for users to be able to represent that some type is null (and search for it as well). If we were to provide some sort of null type, it would allow nulls in json to propagate to the storage level and to be queried back.

There is an active project which is requesting this feature- which is the reason it's a concern.

@eawagner
Copy link
Member

eawagner commented Nov 4, 2014

I sort of have concerns with this. Having an object to represent a null value (Null Object Pattern) seems like a hack as we don't really advocate its use in the rest of the code.

I do agree with you though, that we shouldn't try to support raw null values in either tuples or in the type encoders. Things can get messy very quickly.

I would like to investigate an alternative to this that might meet the use case. For instance, is there a reason that this active project couldn't create their own null type and implement their own encoder?

@cjnolet
Copy link
Member Author

cjnolet commented Nov 4, 2014

I mean that's one possibly but it creates a barrier (however simple it may be) for adoption. The json spec supports nulls as a type. We need to be able to say we take in json and produce the exact same json and as long as there is no way to represent any type of null value, we cannot do that. If we were to use something like NullType to represent this value, it would at least allow us to decouple the type from having a null object state- which would be very bad, I agree.

I'll ponder this for awhile as well to see if I have any other ideas.

@eawagner
Copy link
Member

eawagner commented Nov 4, 2014

I mean if the intent is to start allowing us to model Json in tuples (ala #131) then I would be more inclined to have a "valueless" tuple implementation.

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

No branches or pull requests

2 participants