You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the Chassis object is overscoped. I think it should be broken apart into two MotorInterface/MotorAdapters (implement IHardwareInterface) and a more abstract DriveTrain object.
Trying to obey the Single Responsibility Principle: objects should only do one thing. Right now, the Chassis object is trying to manage too much. It's both delegating messages to the appropriate motors and driving the motors. This responsibility should be broken up. The Communicator is already in charge of delegating messages so Chassis is eclipsing the Communicator's responsibility.
If we want a class in charge of moving the robot, we should create a DriveTrain object that creates messages and sends them to the Communicator for delegation. The Communicator then sends the messages to the appropriate MotorAdapters that then drive the motors.
Thoughts?
The text was updated successfully, but these errors were encountered:
I think the Chassis object is overscoped. I think it should be broken apart into two MotorInterface/MotorAdapters (implement IHardwareInterface) and a more abstract DriveTrain object.
Trying to obey the Single Responsibility Principle: objects should only do one thing. Right now, the Chassis object is trying to manage too much. It's both delegating messages to the appropriate motors and driving the motors. This responsibility should be broken up. The Communicator is already in charge of delegating messages so Chassis is eclipsing the Communicator's responsibility.
If we want a class in charge of moving the robot, we should create a DriveTrain object that creates messages and sends them to the Communicator for delegation. The Communicator then sends the messages to the appropriate MotorAdapters that then drive the motors.
Thoughts?
The text was updated successfully, but these errors were encountered: