You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The design of com.mongodb.jee.util.JSON seems a little confusing?
I understand you want to provide a "JSON helper but with Writer as parameter", but in doing so you have duplicated methods from com.mongodb.util.JSON. For example 'serialize( Object o )' and 'parse( String s )' are identical in both classes.
In a typical Mongo JEE setup, both classes will be available on the classpath. So doing 'Fix Imports' in your IDE will always present both options. It's not obvious which one to use, or which one to prefer. And, over time, their implementations may get out of sync.
Could you perhaps separate your com.mongodb.jee.util.JSON into a JSONWriterUtils class or something? Without the overlapping methods? Then there would be no ambiguity, and people could use the regular 'com.mongodb.util.JSON.parse' for most use cases.
Regards,
Richard.
The text was updated successfully, but these errors were encountered:
To manage streaming, Writer or Outputsream sould be used. I had to copy/paste the original JSON class which works with StringBuilder as parameter. Hope one day the driver will change the signature.
But if you have a better solution, don't hesitate to create a patch.
The design of com.mongodb.jee.util.JSON seems a little confusing?
I understand you want to provide a "JSON helper but with Writer as parameter", but in doing so you have duplicated methods from com.mongodb.util.JSON. For example 'serialize( Object o )' and 'parse( String s )' are identical in both classes.
In a typical Mongo JEE setup, both classes will be available on the classpath. So doing 'Fix Imports' in your IDE will always present both options. It's not obvious which one to use, or which one to prefer. And, over time, their implementations may get out of sync.
Could you perhaps separate your com.mongodb.jee.util.JSON into a JSONWriterUtils class or something? Without the overlapping methods? Then there would be no ambiguity, and people could use the regular 'com.mongodb.util.JSON.parse' for most use cases.
Regards,
Richard.
The text was updated successfully, but these errors were encountered: