0

The purpose/s of this question is to discover what are some of the most reliable methods of achieving communication between existing offline software and a web application.


(Example) Scenario:

A person has written a piece of software that primarily runs "offline" on a cluster/network of local servers (accessible physically).

This piece of software is a structural mapping of the highway system and was written in a language like C++ over many years and has been well maintained.

Now, this person wants to build a web application (in a language like Ruby/Python) that is attempting to take traffic-flow data via a government API and wants to:

  • Take this data and load it into to the offline software
  • Use the offline software to map out better traffic flows (and other statistical analyses)
  • Send this data back to the web application to be communicated via HTML5/Javascript to a client/s

Some points to be held constant:

  • This is the system the client has specified and the only way
  • Both the offline system and the web application will be using SQL for their databases
  • The person has invested a large number of hours and maintenance that do not warrant a rewrite of the offline software

Based on the above, what are some options for achieving this?

Can this be achieved on an application and/or database layer?

Which layer would provide a structure where neither application has to be modified to function with the other application? (separation of concerns)

What is the most common (known) method for achieving such communication?

  • My apologies (in advance) if the question reads like a homework question. I was trying to provide an adequate amount of information and the questions I asked are based on the way I would go about trying to encapsulate/understand the problem before beginning to solve it. – Joe Oct 6 '14 at 1:58
  • 1
    1. I don't see why not. 2. The layer of abstraction that you provide which will achieve this separation of concerns. 3. You'll need to develop some sort of communication infrastructure. What that looks like depends entirely on your specific requirements and the available API of the offline system. – Robert Harvey Oct 6 '14 at 2:30
  • recommended reading: Why is asking a question on “best practice” a bad thing? – gnat Oct 6 '14 at 3:36
  • @gnat maybe I should have used another phrase for the title, as it isn't explicitly looking for a "best practice" but a common method for communicating between systems. Can you suggest an alternate title that might be more appropriate? – Joe Oct 6 '14 at 16:21
1

I've been successful using JSON for communicating between online applications and workstation software.

A possible workflow would be as follows:

  1. Admit input via a web application (e.g., forms, REST-API, text message, what have you)
  2. Emit a "job" id in response to the input
  3. Codify the input as a JSON document
  4. Pass the JSON document to a batch-processing application capable of reading the JSON file and running the workstation application with those inputs
  5. The workstation application stores the results either as a JSON file which can be immediately displayed on the website, or (better), stored in a database which can then be queried by the web application.
  6. Mark the "job id" as done.

The user can now use the job id to retrieve the results. If the whole thing is very rapid you may do it all on-line and dispose of the job id.

Just as suggestion... it has worked for me.

  • Very clear answer. I see that you are doing abstraction on a data level/layer. Is this correct? – Joe Oct 6 '14 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.