Exforsys

Online Training

Is the Mediator the best pattern for a Wizard?

This is a discussion on Is the Mediator the best pattern for a Wizard? within the Software Patterns forums, part of the Testing category; Hello, I need to build a windows wizard (winform in C#) that has 4 - 5 steps depending on the values ...


Go Back   Exforsys > Testing > Software Patterns

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-01-2004, 12:18 AM
myjunkbuster
Guest
 
Posts: n/a
Is the Mediator the best pattern for a Wizard?

Hello,

I need to build a windows wizard (winform in C#) that has 4 - 5 steps
depending on the values the user enters. From my research so far it looks
like the Mediator pattern may be the best solution. However it looks like
the main form would have to create the controller and all the step forms.
This would mean the initial start up would be slow (and costly if they exit
before reaching the final step), the workflow is hardcoded so changing the
flow or adding a new step would mean recoding the controller. Granted in
this case it wouldn't necessarily be the end of the world if that happened
but is there a better pattern for implementing a Wizard?

thanks,
Scott


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2004, 02:13 AM
William Stacey
Guest
 
Posts: n/a
Re: Is the Mediator the best pattern for a Wizard?

I don't know what pattern this would be, but I built a nice looking wizard
pretty easy like so:
1) Create you 1 form.
2) Add a tab control to it and add number of tabs as you have different
pages in the wizard. Each tab will display your next step in the wizard.
You can also skip tabs based on prior input, etc. Use tabs on top
horizontal.
3) The tabs allow you to work very easily with your different controls and
wizard pages.
4) Each tab page will have a Next and/or Prev buttons that you can
disable/enable based on input.
5) When your happy with the wizard, cover up the top tabs with a pic box
using a graphic, etc. Most MS wizards have some kind of gif on top for
examples.

This works very well actually. Please post back if you have other questions
or if I missed something. Cheers!
--
William Stacey, MVP

"myjunkbuster" <myjunkbuster@hotmail.com> wrote in message
news:OI2dnZoY8rM7Am6i4p2dnA@comcast.com...
> Hello,
>
> I need to build a windows wizard (winform in C#) that has 4 - 5 steps
> depending on the values the user enters. From my research so far it looks
> like the Mediator pattern may be the best solution. However it looks like
> the main form would have to create the controller and all the step forms.
> This would mean the initial start up would be slow (and costly if they

exit
> before reaching the final step), the workflow is hardcoded so changing the
> flow or adding a new step would mean recoding the controller. Granted in
> this case it wouldn't necessarily be the end of the world if that happened
> but is there a better pattern for implementing a Wizard?
>
> thanks,
> Scott
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2004, 11:06 PM
myjunkbuster
Guest
 
Posts: n/a
Re: Is the Mediator the best pattern for a Wizard?

Just an FYI here is a link to the Mediator pattern:
http://www.dofactory.com/Patterns/PatternMediator.aspx I believe Fowler
refers to this as an application controller. I'm fiddling around with it and
am making use of .net's visual inheritance. I'm thinking about having the
mediator determine the flow via a config file so that it will be a little
more flexible. Granted this is probably way overkill for a wizard but this
is just a learning exercise.

Thanks for your comment and I will give it a shot too :-)
Scott

"William Stacey" <staceywREMOVE@mvps.org> wrote in message
news:vvi04vgk3s9r7d@corp.supernews.com...
> I don't know what pattern this would be, but I built a nice looking wizard
> pretty easy like so:
> 1) Create you 1 form.
> 2) Add a tab control to it and add number of tabs as you have different
> pages in the wizard. Each tab will display your next step in the wizard.
> You can also skip tabs based on prior input, etc. Use tabs on top
> horizontal.
> 3) The tabs allow you to work very easily with your different controls and
> wizard pages.
> 4) Each tab page will have a Next and/or Prev buttons that you can
> disable/enable based on input.
> 5) When your happy with the wizard, cover up the top tabs with a pic box
> using a graphic, etc. Most MS wizards have some kind of gif on top for
> examples.
>
> This works very well actually. Please post back if you have other

questions
> or if I missed something. Cheers!
> --
> William Stacey, MVP
>
> "myjunkbuster" <myjunkbuster@hotmail.com> wrote in message
> news:OI2dnZoY8rM7Am6i4p2dnA@comcast.com...
> > Hello,
> >
> > I need to build a windows wizard (winform in C#) that has 4 - 5 steps
> > depending on the values the user enters. From my research so far it

looks
> > like the Mediator pattern may be the best solution. However it looks

like
> > the main form would have to create the controller and all the step

forms.
> > This would mean the initial start up would be slow (and costly if they

> exit
> > before reaching the final step), the workflow is hardcoded so changing

the
> > flow or adding a new step would mean recoding the controller. Granted in
> > this case it wouldn't necessarily be the end of the world if that

happened
> > but is there a better pattern for implementing a Wizard?
> >
> > thanks,
> > Scott
> >
> >

>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-07-2004, 06:37 AM
EdUarDo
Guest
 
Posts: n/a
Re: Is the Mediator the best pattern for a Wizard?

I think you need to use State pattern to make a wizard.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 02:42 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.