-
-
Save tuannguyenssu/4e799b2e1e6a6740a4b00b8c18102b28 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 Helper vi phạm SRP | |
public class Helper | |
{ | |
public string GetUser(); | |
public DateTime GetCurrentTime(); | |
public string GetCurrentLocation(); | |
public DbConnection GetDatabaseConnection(); | |
} | |
// Cải thiện class Helper bên trên bằng cách chia nhỏ thành các helper nhỏ hơn | |
public class UserHelper | |
{ | |
public string GetUser(); | |
} | |
public class TimeHelper | |
{ | |
public DateTime GetCurrentTime(); | |
} | |
public class LocationHelper | |
{ | |
public string GetCurrentLocation(); | |
} | |
public class DatabaseHelper | |
{ | |
public DbConnection GetDatabaseConnection(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment