简体   繁体   中英

Ruby on Rails server DB to share in Java Swing Desktop Application

Namaskaram, I am developing a Task Management application to work on both mobile and Desktop. I have selected Java Swing framework for Desktop and Android for Mobile Application respectively.

The server developed in Ruby on Rails.

I want to share Database of server to my Java Swing Desktop Application.

I have no idea, how to connect Ruby on Rails server database to Java Swing application. Please help me.

There are two options here:

  1. Expose JSON or XML endpoints to your Java applications for all data/storage requirements or,
  2. Have the application talk directly to the database which backs the rails application.

The advantage of the first one is that if the rails application does any additional processing to the data, you do not have to replicate this in Java. Also changes can be made on the server without having to update the clients. The main disadvantage of this is that there will be slightly slower communication to the database as you will be going via the rails application.

If you communicate directly with the database then you will have to keep all applications in sync with the database schema. This may be difficult if the schema is rapidly changing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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