rondagostino commented on PR #13280:
URL: https://github.com/apache/kafka/pull/13280#issuecomment-1500542906

   > I think we have to implement Set, Map, and TreeMap.  Using custom types 
just hurts programmer productivity and ability to understand the code too 
much... [it] is a lot of tricky code that we don't really need,
   
   I don't think we have to if we go with a wrapper class -- it is trivial to 
invoke `asJava()` if the programmer wants something that implements the 
standard interface.  If we did want it, it is trivial to delegate all those 
invocations when the underlying library classes already implement those 
interfaces -- which is the case with `PCollections`.  But yes, it would be 
annoyng to have to write it for something like Vavr.  This is why I felt that 
the `asJava()` method is a good solution.
   
   > There is a tension... should we ditch the wrappers and use the libraries 
directly?
   Agreed, there's no perfect solution.  We either sprinkle the PCollections 
code all over the place and have to migrate all of that or we abstract it away 
somehow.  I think we should abstract it away but don't get too crazy about it.  
I think not implementing the standard interfaces, supporting `.asJava()`, and 
providing type safety so people at least know they have a persistent collection 
is a good balance.
   


-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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

Reply via email to