Downcasting - Is it bad design

From: Rupak (rupak_at_hotmail.com)
Date: 05/30/04


Date: Sun, 30 May 2004 20:20:21 +0100

Hi

While I was writing some Java code at work, I realized that I was
downcasting a returned object. When I started compling the code, I got an
error which got fixed by adding a import statement for the package that had
the Class (which I used for downcasting).
I wonder if it is the design which made me downcast the returned object
which in effect put an dependency to this new package. Is downcasting bad
design?

Regards
Rupak



Relevant Pages

  • Re: Downcasting - Is it bad design
    ... Rupak wrote: ... > downcasting a returned object. ... > the Class (which I used for downcasting). ... sure it looks like design may be refactored into better design depending ...
    (comp.object)
  • Re: Downcasting - Is it bad design
    ... > While I was writing some Java code at work, ... > the Class (which I used for downcasting). ... > I wonder if it is the design which made me downcast the returned object ...
    (comp.object)
  • Re: Downcasting - Is it bad design
    ... >the Class (which I used for downcasting). ... >I wonder if it is the design which made me downcast the returned object ... >which in effect put an dependency to this new package. ...
    (comp.object)
  • Re: Downcasting - Is it bad design
    ... >> downcasting a returned object. ... >> I wonder if it is the design which made me downcast the returned object ... additional methods in a derived class API. ... to this kind of OO basics 101, single interface, Circle, ...
    (comp.object)
  • Re: Re: Downcasting - whats the problem?
    ... >> Patterns of Enterprise Application Architecture, by Martin Fowler. ... > appropriate use of downcasting, then darn near 80% of all OO programs ... > type tree base class API, in most OO program type trees is the correct ... > gen/spec anchored in commonality are the lifeblood of OO design. ...
    (comp.object)