Design Principles Flashcards
(22 cards)
What does SOLID stand for?
- Single Responsibility Principle
- Open/Closed Principle
- Liskov Substitution Principle
- Interface Segregation Principle
- Dependency Inversion Principle
Summarize ‘S’
- Every class does one thing
- Responsibility is encapsulated by the class
Summarize ‘O’
- Open for extension
- Closed for modification
- Extend the class rather than changing it
Summarize ‘L’
- Subtypes should be able to act as substitutes of supertypes without any additional modification
- (ie If S is a subtype of T, then S can be used in place of T without throwing any syntax errors)
Summarize ‘I’
-Make many specific interfaces for clients so that they don’t need to deal with information irrelevant to them
Summarize ‘D’
- Add a layer of abstraction between high and low level classes
- Allows us to change both high and low level classes without having to change the other
Difference between Architecture and Design
- Design = low-level code decisions/classes, methods
- Architecture = choice of technologies
Which is more important between architecture and design, and why?
- Architecture
- Architecture choices guide discussion of solutions
- Architecture allows for review
What does NFR stand for, and what are common examples?
- Non-functional requirements
- System qualities that can’t be expressed as features
- Performance, usability, security, availability, robustness, etc.
What issues do successful architectures address?
- Pick the best structure for functional/non-functional requirements
- Pick the best structure to ensure we can build the system given
What does the overall cost of a system depend on?
- Cost of production/debugging
- Cost of maintenance
What are the two types of complexity? What are the differences?
- Inter-module and intra-module complexity
- Intra = complexity within one module
- Inter = complexity between modules
Name types of cohesion from worst to best (Hint: CLITPACIFIER THANKS @ARKON)
- Coincidental
- Logical
- Temporal
- Procedural
- Communicational
- Sequential
- Functional
Name the summarized points of design principles
- Decomposition
- Information hiding
- Minimize coupling
- Maximize Cohesion
- Extensibility
What is coincidental cohesion?
Literally no reason for the two things to be in the same routine.
What is logical cohesion?
Similar things but should still be kept separate
What is temporal cohesion?
Things happen sequentially but still should not be kept together
What is procedural cohesion?
Two operations are together because they are in the same loop/decision process
What is communicational cohesion?
Procedures that access the same data are kept together
What is sequential cohesion?
Procedures that are the next logical step in the sequence
What is functional cohesion?
Procedures kept together as they both have the same function.
What is an embedded system?
Software system embedded within a larger system that is not intended for computation