Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Interface for Puppet #105

Open
huan opened this issue Jul 22, 2020 · 2 comments
Open

Create a Interface for Puppet #105

huan opened this issue Jul 22, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@huan
Copy link
Member

huan commented Jul 22, 2020

When we are developing Wechaty with Puppet Providers, we will always face an error of instanceof mismatch, like

  1. Wechaty Framework must keep only one Puppet instance wechaty#1930
  2. 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.

@huan huan added the enhancement New feature or request label Jul 22, 2020
@huan
Copy link
Member Author

huan commented Nov 13, 2020

A workaround for now: wechaty/wechaty@2e951b7

@huan
Copy link
Member Author

huan commented Nov 13, 2020

Related to wechaty/wechaty#1930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant