The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Wizard based app design

Hello,

My application works with a series of Forms that get information from the user, so in the end some task is performed.

Example
Form1 (asks for Name and other personal information)
Form2 (asks for Directory and filename)
Form3 (asks for ...)

So in each of those there is a Button that loads the next one.

Now the problem is passing information from one Form to the next form.

My initial solution was to create a class or structure that can hold all the necessary information; Start it in Form 1 and pass it to Form 2, and so on.

Example.

Form1_Button_clicked () {
  Data d = new Data ( TextBox1.text, TextBox2.text );
  Form2 nextform = new Form2;
  nextform.d = d;
  nextform.show ();
}

Is there a better way? Thanks.
Spanish Inquisition
Friday, May 18, 2007
 
 
You could put it in the constructor for your new form as opposed to direct assignement.
myPitch
Friday, May 18, 2007
 
 
Hi Spanish Inquisition,

Use a single form rather than a series of them. Each screen's controls can be maintained on a separate page of a tab control or in individual frames (group boxes). The Next and Back buttons would then just alter the visible state (or tab page value) to switch between pages.  You can go one step further and create a Wizard template which can used repeatedly.

Cheers - Marcus
Marcus from Melbourne
Friday, May 18, 2007
 
 
I worked on on app like this a couple years ago. The tricky part was that the layout of the forms varied as you went along, depending on what answers you picked. For example if you said you were a Corporation, it would ask you different questions than if you were a Person. The user could also click Back, which sometimes made previously entered fields invalid. Good Times.
Greg Send private email
Saturday, May 19, 2007
 
 
We've done a fair bit of this. We would typically create a Manager class, that manages a data class or classes and manages the GUI code.

Creating the one form is fine if you've got a simple wizard, but if it's large, or there are different paths through it that class is going to get out of control.

With the manager you can confine the business logic around which forms are shown when to just one method. So when the suits change their mind...and they always do...we've got it easily handled.
Dave Send private email
Saturday, May 19, 2007
 
 
I have my program with a 9page wizard.


i use Panels to put all the controls on..  tehn simply the next button slips through the pannels and shows and hides as needed. with next and previous buttons.


that way is all on 1 form.. and you can refer to data from the controls or you can stroe it  in public variables.
YouKnowMe
Saturday, May 19, 2007
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz