In detail, We can extend any class via Interface, Inheritance or Composition whenever it's required instead of opening a class and modifying it's code.įor example, suppose you have implemented a functionality to calculate area of Rectangle and after some time you need to calculate the area of Square, then In this case you Open Close Principle (OCP) states or ensures that A class, component or entity should be open for extension but close for modification. In other words, Every class should have one and only reason to change it.įor example, In ASP.NET MVC HomeController class should be responsible related to Home Page functionality of software system.ģ. In Object Oriented Programming, Single Responsibility (SRP) ensures that every module or class should be responsible for single functionality supportedīy the software system. Describe the Single Responsibility Principle (SRP). His 2000 paper "Design Principles and Design Patterns".ġ. SOLID Principles is an acronym of 5 principles in Object Oriented Design (OOD). These questions are targeted for Object-Oriented Design Principles like SOLID Principles, DRY, SoC, KISS etc. SOLID Principles Interview Questions and Answers
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |