Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: Chassis object is overscoped. #56

Open
TuckerHaydon opened this issue Apr 26, 2017 · 1 comment
Open

Discussion: Chassis object is overscoped. #56

TuckerHaydon opened this issue Apr 26, 2017 · 1 comment
Assignees

Comments

@TuckerHaydon
Copy link
Collaborator

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?

@TuckerHaydon
Copy link
Collaborator Author

Agreed. Delete this object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants