Skip to content

Refactor CoralSubsystem to remove direct ElevatorSubsystem dependency #28

Description

@coderabbitai

Background

Currently, CoralSubsystem directly depends on ElevatorSubsystem through constructor injection:

class CoralSubsystem(private val io: CoralIO, private val elevator: ElevatorSubsystem)

Problem

This creates tight coupling between these subsystems which may not be ideal for the following reasons:

  • Makes testing CoralSubsystem in isolation more difficult
  • Creates a direct dependency between subsystems that should potentially be independent
  • May cause circular dependencies if ElevatorSubsystem ever needs to interact with CoralSubsystem

Potential Solutions

Consider alternatives such as:

  • Using an event/message bus for communication between subsystems
  • Creating an interface that ElevatorSubsystem implements
  • Using a mediator pattern to handle inter-subsystem communication

References

@Baconing requested this issue to track the concern for future refactoring.

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