Skip to content

Instantly share code, notes, and snippets.

@pseudocoder-in
Created July 9, 2021 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pseudocoder-in/0690724b9183e8aa3066468ba20db4d8 to your computer and use it in GitHub Desktop.
Save pseudocoder-in/0690724b9183e8aa3066468ba20db4d8 to your computer and use it in GitHub Desktop.
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