SynBioDex / pySBOL3

Native python implementation of SBOL 3.0 specification
MIT License
37 stars 16 forks source link

Visitor pattern uses objects and not functions #241

Closed bjkeller closed 3 years ago

bjkeller commented 3 years ago

To follow the canonical visitor pattern in Python, each type should have an accept method that takes a visitor object and then calls a type specific method of the visitor. It is expected that this call require anything else of the visitor than implementing the method as expected by the type class.

For instance

class SubComponent(Feature):

    …

    def accept(self, visitor):
        visitor.visit_sub_component(self)