> -----Original Message----- > From: J. B. Rainsberger [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 09, 2004 2:45 PM > To: Velocity Users List > Subject: Polymorphism (was Re: 'instanceof') > > 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?
I'm talking about from the template point of view. If you are using velocity to display some object (ie. text/html) and the object you are displaying has a 'Shape', why is it so bad for your template to display a box/circle if you can tell that the Shape is a box/circle? The Shape may know how to draw itself form an AWT point of view, but that doesn't apply for text/html. Michael --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]