I'm currently developing a Wizard-like feature for my app in which every step model class is a subclass of a base WizardStep class. I just have three of them now (but they will always be less than a dozen).
I have a WizardController to backend the actual wizard NSView and I'm now facing the problem of how to manage this polymorphic WizardStep class in the UI. Please note that I will do extensive use of Cocoa bindings for each of the step subclasses.
Three solutions came to mind:
1) Create separate NSView(s) for every type of WizardStep, then create an equal number of NSObjectController and bind specific subclass properties between them. When the user moves into a step I will populate the content of the NSObjectController and show the view (as a subview, of course) in the Wizard view.
2) Create separate NSView(s) for every type of WizardStep, then create an single NSObjectController and bind all subclasses properties to it (some of them will be unavailable depending on which type the controller content is). When the user moves into a step I will populate the content of the NSObjectController and show the view (as a subview, of course) in the Wizard view.
3) Create a NSTabView with a tab per each type of WizardStep, then create an single NSObjectController (or use the wizard ViewController) and bind all subclasses properties to it (some of them will be unavailable as in solution 2). When the user moves into a step I will populate the content of the NSObjectController and set the selectedIndex property of the tab view depending on the particular step type.
I feel like solution 1) is the most correct and elegant but I'm afraid it can be an overkill (many NSObjectController, many NSView). Solutions 2) and 3) feel like silly to me (because of the unavailable bindings).
Any advice on how to proceed?
Thank you all, Peter