You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2020/08/13 11:53:50 UTC

[GitHub] [tinkerpop] spmallette commented on pull request #1310: add getter method for GraphSONMessageSerializer

spmallette commented on pull request #1310:
URL: https://github.com/apache/tinkerpop/pull/1310#issuecomment-673432845


   I can see why this change might be necessary, though I think my preference might be to return the TinkerPop `Mapper` object instead. In that way getting a "mapper" becomes generalized to the `MessageSerializer` interface. The `MessageSerializer` would have:
   
   ```java
   Mapper getMapper();
   ```
   
   and then you could just construct your own from that:
   
   ```java
   Mapper<ObjectMapper> mapperObjectMapper = graphsonMessagerSerializer.getMapper();
   ObjectMapper objectMapper = mapperObjectMapper.createMapper()
   ```
   
   I imagine there are some generics to sort out in all this and I'm not sure if it can be done without breaking changes (so perhaps only a suitable change to 3.5.0). It would also require GraphBinary to have a `Mapper` implementation. There could be other problems too. 
   
   I just thought I'd mention this approach as it is a bit more robust than just adding getters for specific class types. Any thoughts on the matter? 
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org