Skip to content

Bus.py: passing in "driver" to (almost) every function call is not good OO #63

@xross

Description

@xross

This approach works, passing in "driver" to (almost) every function call, but is kind of the opposite of object-oriented coding as it combines multiple programming approaches into one class (there are two "classes" of methods in this class)
You could instead have a container object that holds the drivers and resolves the bus state, and each BusWire object (there would now be one for each device on the bus) can reference and manipulate one of the drivers.

Originally posted by @humphrey-xmos in #62 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions