1

We have bunch of API calls, and a list of tasks. Each task uses a combination of our api calls and does something unique after each call using its response (some tasks might use the same api call and after-call action)

Now I'm trying to think of the best way to define these steps so that control can move smoothly between steps, record the progress and also have the ability to continue later on..

Also looking for a way to easily define complex tasks in the future without much hassle.

I have one in place right now but it's very messy, it's actually just a "switch" statement which calls a method which makes the api call and in its response, it calls the switch statement with step_variable+1

I'm using Java on the Android platform..

Tolga E
  • 12,188
  • 15
  • 49
  • 61
  • 1
    Sounds like Strategy Pattern, maybe. Depending on level of abstraction and the real use case. http://stackoverflow.com/questions/91932/how-does-the-strategy-pattern-work – andersoj Feb 21 '12 at 16:52
  • Interesting, reading about it now, thanks – Tolga E Feb 21 '12 at 17:02

0 Answers0