Designing communications for extensibility

Posted by Thomas S. on Programmers See other posts from Programmers or by Thomas S.
Published on 2014-06-09T23:47:19Z Indexed on 2014/06/10 3:41 UTC
Read the original article Hit count: 204

Filed under:
|

I am working on the design stages of an application that will a) collect data from various sources (in my case that's scientific data from serial ports), keeping track of the age of the data, b) generate real-time statistics (e.g. running averages) c) display, record, and otherwise handle the data (and statistics).

I anticipate that I will be adding both data producers and consumers over time, and would like to design this application abstractly so that I will be able to trivially add functionality with a small amount of interface code. What I'm stumbling on is deciding what communication infrastructure I should use to handle the interfaces. In particular, how should I make the processed data and statistics available to multiple consumers?

Some things I've considered:

  • Writing to several named pipes (variable number). Each consumer reads from one of them.
  • Using FUSE to make a userspace filesystem where a read() returns the latest line of data even if another process has already read it.
  • Making a TCP server, and having consumers connect and request data individually.
  • Simply writing the consumers as part of the same program that aggregates the data.
  • So I would like to hear your all's advice on deciding how to interface these functions in the best way to keep them separate and allow room for extenstions.

    © Programmers or respective owner

    Related posts about interfaces

    Related posts about abstraction