Open
Description
When we are developing Wechaty with Puppet Providers, we will always face an error of instanceof
mismatch, like
- Wechaty Framework must keep only one Puppet instance wechaty#1930
- How to develop and debug WecHaty locally wechaty#2024
According to https://stackoverflow.com/a/47116527/1123955, we can define an Interface for our AbstractPuppet class:
interface Puppet extends AbstractPuppet {
}
After that, we can always use the Interface of Puppet and never use instanceof
again, for a better and a beautiful duck typing world.