Can you point me to a nontrivial strategy pattern implementation?

Posted by Eugen Martynov on Programmers See other posts from Programmers or by Eugen Martynov
Published on 2012-01-24T07:01:07Z Indexed on 2012/03/24 17:37 UTC
Read the original article Hit count: 314

We are faced implementing a registration workflow with many branches. There are three main flows which in some conditions lead to one another. Each flow has at least four different steps; some steps interact with the server, and every step adds more information to the state. Also the requirement is to have it persistent between sessions, so if the user closes the app (this is a mobile app), it will restore the process from the last completed step with the state from the previous session.

I think this could benefit from the use of the strategy pattern, but I've never had to implement it for such a complex case. Does anyone know of any examples in open source or articles from which I could find inspiration? Preferably the examples would be from a live/working/stable application.

I'm interested in Java implementation mostly; we are developing for Java mobile phones: android, blackberry and J2ME. We have an SDK which is quite well separated from platform specific implementations, but examples in C++, C#, Objective-C or Python would be acceptable.

© Programmers or respective owner

Related posts about learning

Related posts about object-oriented