Closed kk580kk closed 6 years ago
@kk580kk
I don't know SerializablePlugun specification. But I confirm model class implement java.io.Serializable like this:
@TroyTae We built micorservices by Dubbo framework , and it need java interface to connect each services. In this situation Example class need implement java.io.Serializable to send by rpc.
Now we used enterprise version of dubbo , named HSF . Same problem and same way to solve it.
The Example classes are not designed to be Serializable in general. In most cases it works, but there are cases (esp. user defined types and type handlers) where the Examples might not be Serializable.
This is also true of model classes in the case of user defined types.
So I think it is reasonable to leave it as is. It is very easy to write your own plugin (as you have done) in the case where you know the classes will be Serializable.
@kk580kk I agree with jeffbutler... In general case, people make APIs that have response consists of Model class to connect each other services.
@jeffgbutler @TroyTae I see ,and I almost agree on this point.
In this situation, I was a little lazy to write a query method and a query class model. And example is just enough to search database on most of query functions. So send a Example class to remote service is really easy way to solve it.
Maybe when I have time I need a refactor //todo
We used maven generator and generated XXXXExample class , but this class didn't implements java.io.Serializable, and we got error.
I have edited this java class SerializablePlugin.java and add this code
to fix this issues.
And if there a better solution for this problem.