Loading ...
Sorry, an error occurred while loading the content.

62340Re: [XP] Final Wizard Article

Expand Messages
  • Edmund Schweppe
    Sep 30, 2002
      Charlie Poole wrote:
      >
      > Hi All,
      >
      > The last article in my series on writing a wizard is now posted.
      > I'd appreciate any comments or corrections.
      >
      > The three are all linked from my articles page at
      > http:charliepoole.org/cp.php?p=articles

      A couple of (minor?) nits:

      Are the pages *supposed* to have blank <TITLE> tags?

      In the new Execute() method, the code looks roughly like:

      int step = 0;
      int nsteps = 2;
      Form[] form = { new TestFixtureTypeForm( this ),
      new TestFixtureOptionsForm( this ) };
      while ( step >=0 && step < nsteps ) {
      form[step].ShowDialog();

      etc.
      Doesn't C# support some way to get array lengths easily, along the lines
      of Java's .length property? A separate nsteps variable is duplication;
      and of course, not following DRY means you're all wet!

      You've got a couple of switch statements in there - any thoughts towards
      refactoring them out along the lines of Fowler's Replace Conditional
      With Polymorphism?

      > There's a little commentary at the end of the third article
      > titled "What's It Good For?" which might be an interesting
      > subject of discussion on this list.

      Hmmmm. Is it a useful tool? Perhaps, as you say, it would be useful for
      quickly generating empty tests for big chunks of legacy code.

      I don't think it's that useful for folks doing TDD, though, since you
      need the class before the tool can generate tests. In TDD, you are
      expected to write the test first, then get it to compile, then get it to
      pass.

      --
      Edmund Schweppe - schweppe@... - http://schweppe.home.tiac.net
      The opinions expressed herein are at best coincidentally related to
      those of any past or future employer. The position of present employer
      is currently open; contact me for further information!
    • Show all 4 messages in this topic