Software Engineering, unit: Software Design Principles (SOLID). Core concepts, terminology, and worked-example cues a college student meets for this unit, building on prior units without repeating them. Front: a term, concept, or short problem cue. Back: the definition, explanation, or answer.
16 cards · basic cards · AI-written, checked twice. Edit anything.
- What is SOLID, in software design?
- An acronym for five principles guiding maintainable, extensible object-oriented design
- What does the Single Responsibility Principle state?
- A class should have only one reason to change
- What does the Open/Closed Principle state?
- Software entities should be open for extension but closed for modification
- What does the Liskov Substitution Principle state?
- Objects of a superclass should be replaceable with objects of a subclass without breaking correctness
- What does the Interface Segregation Principle state?
- Clients should not be forced to depend on interfaces they do not use
- What does the Dependency Inversion Principle state?
- High-level modules should depend on abstractions, not on low-level implementation details
- Why is the Single Responsibility Principle useful?
- It keeps classes focused and easier to understand, test, and modify
- How does the Open/Closed Principle typically get achieved?
- By using abstraction and polymorphism to add behavior without altering existing code
- What happens if the Liskov Substitution Principle is violated?
- Substituting a subclass for its superclass can produce incorrect or unexpected behavior
- What is a 'fat interface', which the Interface Segregation Principle warns against?
- An interface with too many unrelated methods, forcing implementers to support methods they don't need
- What is dependency injection, related to the Dependency Inversion Principle?
- Supplying a class's dependencies from outside rather than creating them internally
- What is coupling, in software design?
- The degree of interdependence between software modules
- What is cohesion, in software design?
- The degree to which the elements within a module belong together
- Why is low coupling and high cohesion generally desirable?
- It makes code easier to understand, test, and change independently
- What is code smell?
- A surface indication in code that often corresponds to a deeper design problem