Skip to content

Create a Interface for Puppet #105

Open
@huan

Description

@huan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions