How do I create a concise and RESTful wizard under MVC?

前端 未结 3 1980
忘了有多久
忘了有多久 2020-12-23 23:31

I try to be as RESTful as possible in building applications but one thing that I\'m never sure about is how to create a wizard-type work flow, be RESTful and concise.

3条回答
  •  悲哀的现实
    2020-12-24 00:33

    I'm actually less concerned about maintaining REST in a one-shot wizard. REST is most important, I think, with repeatable actions -- you want the url to be basically bookmarkable so that you get back the same view of the data regardless of when you go there. In a multi-step wizard you have dependencies that are going to break this perspective of REST anyway. My feeling is to have a single controller with potentially separate actions or using query parameters to indicate what step you are on. This is how I've structured my activation wizards (which require multiple steps) anyway.

提交回复
热议问题