Kayıtlar

Haziran, 2016 tarihine ait yayınlar gösteriliyor

SOLID Design Principles

In this article, i will try to summarize the SOLID principles of object-oriented design. The concept of SOLID principles were described first by Robert C. Martin in his paper Design Principles and Design Patterns . Later on, the SOLID acronym was introduced by Michael Feathers for these principles. And here is the SOLID principles that we will outline in this article:  S ingle Responsibility O pen-Closed L iskov Substitution I nterface Segregation D ependency Inversion 1. Single Responsibility Principles (SRP) The key points that this principle says: - A class should have only one responsibility - A class should only have one reason to change - If the class belongs to domain model, it should represent only the relevant business entity. Benefits: - Testing: Less responsibility means fewer test cases - Loose coupling: Less responsibility means fewer dependencies 2. Open-Closed Principle (OCP) The key points that this principle says: - Open for extension A class