Skip to content

Instantly share code, notes, and snippets.

@tuannguyenssu tuannguyenssu/SrpHelper.cs Secret
Created Jul 7, 2019

Embed
What would you like to do?
// 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
You can’t perform that action at this time.