Somewhere you want to use an instanceof check. In general, a performs an instanceof check in an 'if' statement of some kind.
So apply Replace Conditional with Polymorphism [Refactoring],
which generally introduces a Strategy [GoF:Design Patterns] into
the design. Of course, I'm just guessing, but it's a pretty good
bet.
How would you test for specific instances of a polymorphic class in the view? If the view gets a Shape, no reason why the view can't test for Circle, Square, or ? to display a specific thing for the viewer...
Why not just invoke draw() on the Shape and let /it/ figure things out? That's the whole point of polymorphism. If you're just going to ask the object what type it is, then decide what to do with it as a result, then why have polymorphism at all?
--
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]