vendredi 22 avril 2016

Choosing a Design Pattern with DI

I have an application that allows my users to schedule various tasks to run at certain times. Each task is broken into sub-tasks representing chunks of work. For example, imagine a task with a series of subtasks like this:

  1. Download files to server from an FTP location
  2. Process the files
  3. Push the processed files into a database
  4. Clean up

I would like to carefully track the status of these running tasks as they progress though their steps, both for informational purposes and also to maintain state so tasks that fail can be re-tried (for example, imagine the database is down so it fails on subtask 3 above. Once the DB is up again, I'd want to be able to retry it so it would pick up exactly where it left off)

What kind of design pattern or framework would you recommend to best accomplish this as cleanly as possible? I'm using DI with Castle Windsor for quite a bit of my application already so I'd like to integrate it with that so I can easily swap out the implementation for how the state of each task is stored.

Aucun commentaire:

Enregistrer un commentaire