mobie / mobie.github.io

1 stars 3 forks source link

Support "RealTransform" transformations #30

Open constantinpape opened 3 years ago

constantinpape commented 3 years ago

https://github.com/BIOP/qupath-biop-extensions/tree/imglib2-include/src/main/java/ch/epfl/biop/qupath/transform

constantinpape commented 3 years ago

cc @martinschorb @NicoKiaru @tischi

tischi commented 3 years ago

@NicoKiaru

Do you know if the convention is to put the "type" only in case of the field being an interface? Would make sense to me, because if it is not an interface, on the Java code side, it is clear from the class of the field what it should be.

However, from human readability point of view it could be nice to spell out the type also if it is not an interface, but then I think one looses quite some of the convenience of the JSON magic.

NicoKiaru commented 3 years ago

Do you know if the convention is to put the "type" only in case of the field being an interface?

I think so, in fact in most cases you don't need to write adapters, because the object can be easily serialized. It's not really a convention, it's because there's no other convenient.

However, from human readability point of view it could be nice to spell out the type also if it is not an interface, but then I think one looses quite some of the convenience of the JSON magic.

Gson is powerful and configurable, it is probably possible to set it in such a way that the type of the object is always written (but what happens if you serialize an int?)