Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Vehicle {
public:
int speed;
Engine* engine;
int mileage;
void changeSpeed();
void changeDirection();
void repair(); // Violate SRP
}
// FIX
class Garage {
public:
void repair(Vehicle* vehicle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment