method with two parameters which both need to be double dispatched

Posted by mixm on Stack Overflow See other posts from Stack Overflow or by mixm
Published on 2010-05-19T09:57:48Z Indexed on 2010/05/19 10:00 UTC
Read the original article Hit count: 305

Filed under:
|
|

lets say i have a method which has two parameters. i have been implementing them as:

if(aObj instance of Marble)   {
   if(bObj instance of Bomb)   {
      this.resolve((Marble)aObj,(Bomb)bObj);
   }
}

as you can see its not a very pretty solution. i plan to implement using double dispatching, but with two parameters which both need double dispatching, im afraid im a bit stumped. any ideas please.

im implementing in java btw.

© Stack Overflow or respective owner

Related posts about double-dispatch

Related posts about java