Saturday, December 25, 2004, 5:24:42 AM, Ron Jeffries wrote:
> People generally see that the tenth frame is different: it has two
> small squares, not just one. And when they think about the object
> design for frames, they commonly come up with the idea of a
> polymorphic Frame object, OpenFrame, StrikeFrame, SpareFrame, and
> quite often at least one type of TenthFrame.
> My classes and demonstrations of TDD don't ever go that way. In the
> first C# bowling article on my site, I pushed the design to those
> objects, primarily by forcing the interface. The interface to the
> game actually /tells/ the game whether the next frame is strike,
> spare, open. Cheating, if you ask me. But if the strike or spare
> aren't identified before the frame is created, it's too late to
> choose the right subclass.
Well.... Since you're using Smalltalk this time, that is not
quite a true statement. It's completely possible to start with
an open frame, then have it become a spare, or strike frame,
when it discovers it needs to. I don't think I would have ever
come up with this design approach without your statement
above, and it's a design pattern I discourage, but it might be
really slick in this case. It also shows a capability built
into Smalltalk that just isn't readily available in other
languages.
--
Doug Swartz
[EMAIL PROTECTED]
To Post a message, send it to: [EMAIL PROTECTED]
To Unsubscribe, send a blank message to: [EMAIL PROTECTED]
ad-free courtesy of objectmentor.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/extremeprogramming/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/