-
-
Save pseudocoder-in/0690724b9183e8aa3066468ba20db4d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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