views:

46

answers:

2

Hi all!

I have to extend an existing program (Java-based, but this shouldn't count). This program should communicate with another program X.

This program X is .. uhm.. a little bit older and supports only file based communication. This means I have to put my file into some specific folder. The "answer" is placed in another folder where I have to pick it up.

Are there any design patterns for this kind of communication? Problems with file-locking, unflushed io-streams etc. come to my mind if I think about it.

Do you have some more descripte keywords for my googleing? "file based communication" doesn't take it.

Thanks in advanced for any hint!

A: 

Maybe Producer-Consumer pattern is what you want.

I belive you'll find better articles then the article in wikipedia. But main concepts are described there clear enough (just replace 'buffer' with 'file' for your concrete case).

John Doe
A: 

I don't know if it is possible to create file system watchers in java (like it is in C#), but I do always use a file system watcher to monitor the folder which receives files.

Carlos Loth