Skip to content

Instantly share code, notes, and snippets.

@tuannguyenssu tuannguyenssu/DIPBefore.cs Secret

Created Jul 7, 2019
Embed
What would you like to do?
// Cart là module cấp cao
public class Cart
{
public void Checkout(int orderId, int userId)
{
// Database, Logger, EmailSender là module cấp thấy
Database db = new Database();
db.Save(orderId);
Logger log = new Logger();
log.LogInfo("Order has been checkout");
EmailSender es = new EmailSender();
es.SendEmail(userId);
}
}
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.