Skip to content

Instantly share code, notes, and snippets.

@tuannguyenssu
Created July 7, 2019 08:59
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 tuannguyenssu/aef3c397ec8263c322ffdabb37f94db3 to your computer and use it in GitHub Desktop.
Save tuannguyenssu/aef3c397ec8263c322ffdabb37f94db3 to your computer and use it in GitHub Desktop.
// 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