> Hello all,
>
[quoted text clipped - 18 lines]
> Thanks
> Student
Unfortunately, no.
however, if you have a lot of "if instanceof" chains, you probably
should look into making this object polymorphic instead. It'll produce
cleaner code, and let X,Y,Z, and J decide on how they want to handle "do
something"

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
studentoflife77@gmail.com - 16 Nov 2007 00:40 GMT
I agree with you. Unfortunately I am using a library given by some
other team in which I have to check instanceof for 7 different classes
and then call the same getXX() method. i dont know why they didn't
pull this method into the base class.
The only reason i can think of is that in their hierarchy there must
be more than 7 sub classes from the same base class and the other
classes (apart from the 7 having the method) may didn't require the
same getXX() method
thanks
Student
On Nov 15, 6:38 pm, Daniel Pitts
<newsgroup.spamfil...@virtualinfinity.net> wrote:
> studentoflif...@gmail.com wrote:
> > Hello all,
[quoted text clipped - 28 lines]
> --
> Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Daniel Pitts - 16 Nov 2007 01:13 GMT
[some top posted reply, fixed below]
Please don't top post.
> On Nov 15, 6:38 pm, Daniel Pitts
> <newsgroup.spamfil...@virtualinfinity.net> wrote:
[quoted text clipped - 33 lines]
>> thanks
>> Student
My suggestion is to ask the other team to add that method to a base
class or at least to an interface. If you can't the other team to make
changes, than they aren't your friends :-)
If you are feeling particularly proactive, you might even suggest to the
other team that you can make the change yourself.

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>