Object-oriented design
SOLID and good design
Five rules that keep classes easy to change.
In two minutes
One idea to a line
Single responsibility: a class has one reason to change.
Open/closed: add behaviour by adding code (a new subclass), not by editing tested code.
Liskov substitution: a subtype can stand in for its base type without breaking the program.
Interface segregation: many small interfaces are better than one big one a class half-implements.
Dependency inversion: depend on abstractions, and pass dependencies in, instead of creating them inside.
Slips people make here
Interviewers know them too
Reading single responsibility as "one method per class".
Breaking Liskov by overriding a method to throw "not supported".
Calling dependency injection and dependency inversion the same thing: injection is one way to achieve the inversion.
Your practice here
Not started
12 written questions
No answers yet