I’ve worked on two big MVC apps since dec 2008 see my linkedin profile for details.
Both have required session persistence for wizards and complex forms, this was just a stab at refactoring this experience into a class.
So no I’ve not used these classes in production yet, but a lot of similar code is working in production, no guarantees I’m afraid.
Some other options:
– Persist to a repository e.g. DB
– Use temp data which also uses session(Ajax calls may be a problem).
– Have a single page and show and hide the form elements, I worked on another project that worked well with this approach.
Hope this helps Simon ;o)]]>
Very interesting article. I have a web application that requires the user to build a complex ‘Order’ over a large number of steps. I have struggled to identify the best approach for maintaining the state of the Order as it is being built.
I am surprised that there seems to be very little on the web or documentation that describes the options.
My latest thinking matches yours whereby I use Session to store the ‘OrderViewModel’ during the steps. When ready to submit I map this to the domain entities for saving (I am using Entity Framework).
I am yet to implement this and your approach looks good.
Did you have a similar journey to get to this point? Did ‘alarm bells ring’ by the fact that this seems to be such an uncommon requirement that you might be doing something wrong? This is certainly the case for me – I thought this was a relative common requirement yet so little discussion is out there about state and persistance before saving.
Can you point me to any other sources of information related to this?
Have you actually applied this to a complete application? If so what is your experience with this approach?
Sorry about all the questions – you don’t have to answer them all!! 😉