Skip to content

RFC: statemachine.State as an interface instead of a struct #135

@schmichael

Description

@schmichael

Pros to an interface

  • Users can tuck extra metadata into their implementation
  • Manually creating State structs smells funny

Cons to an interface

  • Allows "clever" implementations of methods that should just be getters for immutable values
  • Suggests/forces custom implementations which is extra work for users
  • Custom implementations mean Yet Another Place to Hide State.

Since #133 just merged I'd rather see how far the Task interface gets us than rush and interface-ify everything and create useless complexity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions