简体   繁体   English

JAVA同步

[英]JAVA Synchronisation

I have a master program, and a client program. 我有一个主程序和一个客户端程序。 Whats the best way in Java to connect these two programs so they are synchronized, where if one change on one program happens then the change happens on the other?. 用Java连接这两个程序的最佳方法是什么,以便它们同步,如果一个程序发生一个更改而另一个程序发生了更改,那是什么? The programs are identical but the GUI is different one for a mobile device and the other for a computer. 程序是相同的,但GUI对于移动设备和用于计算机的GUI是不同的。

I have tried looking on the internet but have just been baffled. 我曾尝试过在互联网上寻找内容,但感到困惑。 If anyone can point me in the right direction that would be great. 如果有人能指出我正确的方向,那就太好了。

Thanks. 谢谢。

Make a server with some web services. 使服务器具有一些Web服务。 Then all your programs will be communicating with the server. 然后,所有程序都将与服务器通信。 You don't have to write something twice - you just change the UI layer and than you can it easily run it everywhere. 您不必写任何东西-只需更改UI层,便可以轻松地在任何地方运行它。

You solution has a big flaw - if you liked to add one more device (other mobile platform), the coding would be enormous and too difficult. 您的解决方案有一个很大的缺陷-如果您想添加一个设备(其他移动平台),那么编码将是巨大的,而且太困难了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM