INTRODUCTION TO NET
APPLICATION DEVELOPMENT
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
SRP-Single responsibility Principle
|
|
OCP-Open-Closed Principle
|
|
ISP-Interface Segregation Principle
|
|
DIP-Dependency Inversion Principle
|
Detailed explanation-1: -The idea behind the SRP is that every class, module, or function in a program should have one responsibility/purpose in a program. As a commonly used definition, “every class should have only one reason to change". The class above violates the single responsibility principle.
Detailed explanation-2: -The Single Responsibility Principle (SRP) states that each software module should have one and only one reason to change. In other words, one should gather together the things that change for the same reasons.
Detailed explanation-3: -The single-responsibility principle is a computer-programming principle that states that every module, class or function in a computer program should have responsibility over a single part of that program’s functionality, and it should encapsulate that part.
Detailed explanation-4: -The Interface Segregation Principle is one of Robert C. Martin’s SOLID design principles.
Detailed explanation-5: -=> Reusability If a class has multiple responsibilities and only one of those needs in another area of the software, then the other unnecessary responsibilities hinder reusability. Having a single responsibility means the class should be reusable without or less modification.