0

I'm working on a large project (teams are working separately) and now that most of the apps are finished, we need to integrate everything together. A lot of apps/forms need to communicate information to other apps/forms or solicit information from others; I wonder if there are standard ways of doing this. The way we are planning to do that is through the use of shared files (e.g. one app writes info to a file and the other reads it). Any suggestions?

mrk
  • 3,061
  • 1
  • 29
  • 34
  • Depends very much on what you want to share, and when. Could you add some context? Roughly describing the workflow that your various apps participate in would help - as well as whether these apps are co-resident on the same box, constitute part of a distributed application, etc. – Val Akkapeddi Apr 07 '12 at 20:08
  • 1
    I would use a central database to communicate. – Uwe Keim Apr 07 '12 at 20:13
  • @ValAkkapeddi It's a language learning app (client-server). Here is a quick scenario: teacher logs in (account mgmt app) -> teacher create/edits/... quizes or tests, grades finished exos and so on (test createion app). The latter app needs the teacher's credentials to work. – mrk Apr 07 '12 at 20:15
  • @UweKeim Thanks, could you provide more details? – mrk Apr 07 '12 at 20:16

3 Answers3

1

Yes, as @Uwe Keim said in a comment, you should definitely use a database for everything. A SO answer is not the place to start teaching you about relational databases and how to use them properly from C# applications, though. You should tell the person managing the teams that's the way to go, and have them figure out who to hire to solve this.

zmbq
  • 38,013
  • 14
  • 101
  • 171
0

As regards your question, I think that there is an obvious drawback in using the file-shared solution, which is the delay in your operation because of IO operations.

Moreover, there are other options, please see below:

To fully implement your requirements, you should separate the communication between applications and the communication among forms inside a application.

To implement communication between applications, I would suggest that you use the subscriber/publisher pattern using WCF. The implementation is quite easy. You can google it. One example is here. By doing that, you could control exactly when something happens and the other application should re-acts as you expects.

To implement communication amongst forms in an application, it'd better to create an event aggregator using the Pub/Sub pattern, and then inject it into your application. You can have a look at how it implemented in SCSF.

Toan Nguyen
  • 11,263
  • 5
  • 43
  • 59
0

Another solution is to implement a message protocol to make the apps communicate each other. To avoid bottlenecks, a message queue service can manage the messages exchange.

References:

Alberto De Caro
  • 5,147
  • 9
  • 47
  • 73