mardi 21 mai 2019

How to do type-check in java when receiving response from python server?

Recently I've been considering about using Python to re-write my Java server scripts. I don't have much developing experience, and the sever is meant to support an android application.
When using Java as a server language, there won't be any problem on type-checking because android uses Java as well. But Python's simple grammar may lead to confusion.

If I use return new ArrayList<>();(Java) on server, I can just use
ArrayList<T> list = (ArrayList<T>)object; to transfer and use the response at front-end.
But what if I use return [](Python) on server? What should I do with the response object at the front-end?
Also, those types which doesn't seem to exsit in Python confuses me as well. Like class Date class Map, etc.
I think using json to format and deliver response is a choice, but is there a more profound connection in data type between these two languages?




Aucun commentaire:

Enregistrer un commentaire