Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design pattern for multiple view states?

I have an application that takes the user through a set of steps, configuring a product, say about 10+ screens. With options to go back, skip to a certain point etc. I need to fade between these steps, and also have language switches available at any point.

I was thinking of using an MVC style pattern, having a master view that accepts a ‘next view’ and fades it in, removing the old.

It feels bloated to have 10+ separate view classes, using similar components for this task, so was wondering what other approaches there are that I should look into? or one that is suited for this kind of application

like image 965
davivid Avatar asked May 27 '11 08:05

davivid


1 Answers

Before separating your views, think first of what they have in common.

My first instinct would be to create a View class and set the necessary properties for the view itself, namely fading between screens and whatever else you need that has to do with design.

You say the user would configure a product , so you may want to create a Configuration class , solely for that purpose. Be careful not to introduce too much dependency between your objects.

The Configuration class shouldn't know too much about the View class, more specifically about the way it is displayed.

It's difficult to tell more without knowing your project , but the idea would be to separate view & data , look at what your objects have in common , then use variables or other objects to introduce more specificity.

like image 200
PatrickS Avatar answered Oct 13 '22 12:10

PatrickS