Pergunta de entrevista da empresa Tata Consultancy Services

Explain the concepts of SOLID

Resposta da entrevista

Sigiloso

20 de mar. de 2024

S:A class should have only one reason to change. Each class should have only one responsibility or should only be concerned with one aspect of the program's functionality. O:Software entities should be open for extension but closed for modification. Liskov Substitution : Objects of a superclass should be replaceable with objects of its subclasses without affecting the correctness of the program. Interface Segregation Principle (ISP): A client should not be forced to implement an interface that it doesn't use. Instead of having a large interface with many methods, split it into smaller and more specific interfaces so that clients only need to implement the methods they require.