DesignPatterns: what is most suitable for a wizard style user interface?

I am implementing a wizard style user interface. As the user navigates through the wizard, clicking next, depending on the choice they have selected on each screen, the user will have to go through a specific set of wizard screens.

This is created in ASP.NET MVC. I am wondering which design template is best for implementing the logic of the sequence of steps that are in the wizard. Again, they have several paths through the wizard, depending on the choices they make.

Can I use a linked list? " team design pattern "? What do you recommend?

In other words: Where / How do you abstract / encapsulate the logic of determining what is the next step in the wizard, based on what the user selected at the specific step of the wizard?

+5
source share
4 answers

In other words: Where / How do you abstract / encapsulate the logic of determining what is the next step in the wizard, based on what the user selected at the specific step of the wizard?

One way to do this is to simulate the Wizard, Step, and Product classes. Maybe something like this?

public class Wizard
{
  public Step forward() {//...}

  public Step backward() {//...}

  public Step current() {//...}

  public Product getProduct() {//...}
}

public class Step
{
  public String name() {//...}

  public void commit(Product product) {//...}

  public void rollback(Product product) {//...}
}

public class Product
{
  //...
}

The goal of the wizard is to create a product (car, computer, vacation, etc.).

, - , , . Builder , Wizard, . , , . , Wizard.

Command Pattern /.

+1

" State" , .

. , Windows Workflow.

+3

. , , , , , , , . , , , , , , .

+1

.

, , GUI , .

If what he is trying to build is really a master, each screen should go into no more than 2-3 different screens (IMO). This can be easily stored in a very simple structure (Database, static configuration file).

0
source

All Articles