views:

27

answers:

3

Given a set of external apps (app1.exe, app2.exe, ... ). Invoking one app will change something. Sometimes the result needs to be analyzed, sometimes is just a prerequisite for other apps. If one fails, abort process.

All apps need to be invoked, in a specific order, and they must succeed in order to finalize without errors.

Is there any design pattern for such a scenario?

A: 

Do you mean a shell script?

To implement such an "execution tree", you usually use some basic, specialized programming language to execute the apps in correct order and apply various testing and processing commands on the results.

UNIX shell scripts / Windows batch or PowerShell files are the typical tools used for this purpose.

MaxVT
A: 

Producer/Consumer pattern? You could create 'commands' that represent the external apps and place them in a queue, this would be the job of the Producer. The Consumer would then execute one task at a time and analyze the result of that task before fetching the next one from the queue.

willcodejavaforfood
A: 

you might consider the proxy pattern for this as it would abstract away all the details of dealing with the external apps.

Attilah