views:

67

answers:

2

Basically need to ask user a set of questions and gather information along the way. Each question could have impacts on different questions down the road. Another example would be turbo tax's web interface, answering yes on some ?s may trigger future questions.

Seems like this would be a fairly common problem in software so I guess I'm asking if there are any existing solutions/Design Patterns out there that could help. Kind of seems like a state machine, but I think that is an oversimplification.

+2  A: 

State pattern

Arseny
+2  A: 

Look at this picture which helps with choosing correct fonts which is called So You Need a Typeface (big image there!).

It asks you numerous questions and at some point suggest you one or several answers.

As I understand you want to create something similar but interactive and about another domain.

So, you need to construct similar graph with branching-nodes and leaf-nodes. It can be done very conveniently with the Composite pattern. If you already have (know) all possible questions (or if you know that at some point you will know all of them and will be able to add them manually to the system) then it's the way to go.

If you want something more dynamic and intelligent then the solution can highly vary from case to case.

Roman