1/15
These flashcards cover key concepts and principles from the CPSC 310 lecture on software engineering, focusing on design principles like SOLID, abstractions, encapsulation, and responsibilities within software design.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What does the acronym SOLID stand for in software design?
It stands for Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion principles.
What is the Single Responsibility Principle (SRP)?
A class should have only a single responsibility and only one reason to change.
What is the Open/Closed Principle (OCP)?
A class must be closed for modification but open for extension.
What is the purpose of Abstraction in software engineering?
To manage complexity by focusing on key aspects relevant to a task and stakeholder.
How does Encapsulation relate to Abstraction?
Encapsulation is a method of implementing Abstraction by bundling data and behavior together.
What is meant by Information Hiding?
The practice of hiding implementation details from high-level interfaces.
What is Decomposition in software design?
The process of breaking down complex descriptions into manageable pieces.
What does the Liskov Substitution Principle (LSP) state?
Subtypes must be substitutable for their supertypes without affecting the correctness of the program.
Give an example of a violation of the Single Responsibility Principle.
A class that handles employee payroll calculation, data storage, and reporting functions.
What is a consequence of violating the Open/Closed Principle?
You may need to modify existing code instead of extending it, which can introduce new bugs.
What is a code smell in the context of software engineering?
An indicator that there is a potential problem in the code like a violation of design principles.
Why is it important to adhere to design principles like SOLID?
To create software that is maintainable, scalable, and easier to understand.
What is the relationship between SRP violations and divergent changes?
Divergent changes indicate SRP violations; the same class should not handle multiple responsibilities.
What does encapsulating behaviors in a new abstraction imply in object-oriented programming?
It usually signifies the creation of a new class or interface to manage specific functionalities.
What role does modular design play in software engineering?
It promotes better organization and separation of concerns, making systems easier to manage.
How can one identify a violation of the Liskov Substitution Principle?
By observing that substituting a subclass breaks the functionality expected from the superclass.