Good Programming Practices

I love Onion Architecture since it focused on the domain as the core part of your application.

  1. Use SOLID Principles:
    • Single Responsibility Principle
    • Open/Close Principle: Open to extends / Close to change
    • Liskov Substitution Principle
    • Interface Segregation Principle
    • Dependency Inversion Principle
  2. Don’t put an interface to your Business Logic. For example, if your BLL is about taking payment and send an email, you should inject the services that are responsible to do that, and the BLL simply call those method in a logical way.
  3. Focus your Testing on Business Logic. For example, don’t test Entity Framework (EF) DbSet<Item>.Add(item); , instead test your BLL  _inventoryService.AddItem(item);

 

More Information:

http://jaider.net/handy-tricks/#ASP.NET MVC Solution Best Practices

Handy Tricks & Doc