开发者

Communication between Python and Jython(JAVA) App over nework

开发者 https://www.devze.com 2023-03-29 13:16 出处:网络
I am going to develop a Saas ( Software as a Service )based application , which uses a python app which will run on the server and a client GUI which will be running as a jython app. Initially my plan

I am going to develop a Saas ( Software as a Service ) based application , which uses a python app which will run on the server and a client GUI which will be running as a jython app. Initially my plan is that the client will be developed in Jython for prototyping purposes, but later if the application complexity increases and depending on jython's performance deterioration , I will port the client entirely to JAVA.

Now, I wanted to explore a way so that I can have a effective TCP/IP communication between the server and client apps using some well known tools like Twisted. I was also thinking of other options like corba and pyro.

So based on this I have this questions.

What would be the most effective way of TCP/IP socket communication between a python and jython client. Can I use twisted at the python end and java socket api at the jython end (are they compatible) ? Or is there any other better way ( f开发者_StackOverflow中文版or prototyping & RAD purpose ) ?


I recommend to use RPC, instead of pure TCP/IP communication via sockets.

If there's few clients, and you don't want to engage with complicated technologies, use something like JsonRPC or XMLRPC. (Note that Pyro can only be used when both server and client written in Python. If you plan to move to Java later, you should consider this.)

If performance and security is important here (e.g. lot of clients sends requests at the same time, or you need SSL connection) use something like Ice. I prefer Ice over Corba, because it's more simple, more modern, and yet as good as Corba (Maybe even better).

Update: After I read your comments, I really recommend you to use Ice. Ice and Corba and technologies like them calls ORB (Object Request Broker) They're not use traditional server/client model. So, all of the objects in the application can communicates with each others. No matter where they are. In this case, you'll have a real distributed application.


You could use twisted, nothing wrong with that, I'd recommend zeromq though. It's really fast, and makes writing networked apps really simple.

0

精彩评论

暂无评论...
验证码 换一张
取 消