The Strategy
pattern seems to suit this down to the ground. Here is the link to the wikipedia article, which should be more than enough to get you started, and because you've provided 0 code, I think I won't either.
But because I'm feeling nice
Firstly, I would have them implementing a common interface or superclass. This is so you don't need to test what type of class they are. Simply have them call the same method. I know you've said polymorphism is out of the question, but I'm not sure why. And if you don't have access to the super class.. make a common interface.
For example:
// Undesirable syntax.
if(obj instanceof Dog)
{
((Dog)obj).woof();
}
else if(obj instanceof Cat)
{
((Cat)obj).meow();
}
else if(obj instanceof Lion)
{
((Lion)obj).roar();
}
Now let's define some common interface, Animal
:
public interface Animal
{
public void speak();
}
And now your instanceof
tree looks like this:
public void makeTalk(Animal obj)
{
obj.speak();
}