Font size
WorksheetsDesign Patterns Quiz 01
Total questions: 21
Worksheet time: 15mins
Concerning the solid principle which of these is odd?
Dependency Inversion Principle
Liskov Substitution Principle
Interface Segregation Principle
Single Reconstruction Principle
A specific form of decoupling where conventional dependency relationships are established from high-level, policy-setting modules to low-level, dependency modules are reversed for the purpose of rendering high-level modules independent of the low-level module implementation details.
• High-level modules should not depend on low-level modules; both should depend on abstractions
• Abstractions should not depend on details; details should depend on abstractions
Open/Closed Principle
Liskov Substitution Principle
Single Responsibility Principle
Dependency Inversion Principle
..........'s notion of a behavioral subtype defines a notion of substitutability for mutable objects; that is, if S is a subtype of T, then objects of type T in a program may be replaced with objects of type S without altering any of the desirable properties of that program (e.g., correctness)
Open/Closed Principle
Liskov Substitution Principle
Single Responsibility Principle
Dependency Inversion Principle
Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. That is, such an entity can allow its behavior to be modified without altering its source code.
Open/Closed Principle
Liskov Substitution Principle
Single Responsibility Principle
Dependency Inversion Principle
• Classes that implement interfaces should not be forced to implement methods they do not use. Another way of putting it is: use small interfaces, not fat ones
• Focuses on the cohesiveness of interfaces with respect to the implementors that use them
• Keep each implementation independent of interfaces that they do not use. If you need to change one interface, you shouldn't need to change the other
Open/Closed Principle
Interface Segregation Principle
Liskov Substitution Principle
Single Responsibility Principle
Dependency Inversion Principle
Every object should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.
Open/Closed Principle
Interface Segregation Principle
Liskov Substitution Principle
Single Responsibility Principle
Dependency Inversion Principle
What is the Interface Segregation Principle?
Classes that implement interfaces should not be forced to implement methods they do not use. Another way of putting it is: use small interfaces, not fat ones
Focuses on the cohesiveness of interfaces with respect to the implementors that use them
Keep each implementation independent of interfaces that they do not use. If you need to change one interface, you shouldn't need to change the other
Classes implementation should only be modified to correct errors; new or changed features would require a subclass be created
What is the Interface Segregation Principle?
Classes that implement interfaces should not be forced to implement methods they do not use. Another way of putting it is: use small interfaces, not fat ones
Focuses on the cohesiveness of interfaces with respect to the implementors that use them
Keep each implementation independent of interfaces that they do not use. If you need to change one interface, you shouldn't need to change the other
High-level modules should not depend on low-level modules; both should depend on abstractions
What is the Dependency Inversion Principle?
A specific form of decoupling where conventional dependency relationships established from high-level, policy-setting modules to low-level, dependency modules are reversed for the purpose of rendering high-level modules independent of the low-level module implementation details.
True
False
The following which is NOT a category of relationships between objects are...
Association
Externalization
Dependency
Generalization
Having a "has-a" relationship which states that a class has relationships with other classes is the meaning of ...
Association
Externalization
Dependency
Generalization
Each class should have only one responsibility and one reason to change. Is the definition of ...
Open Close Principle
Dependency Inversion Principle
Liskov’s Substitution Principle
Single Responsibility Principle
Open / Close Principle is a state when ...
open for change, but closed for new specification
open for access, but closed using private
open for modification, but closed for extension
open for extension, but closed for modification
Many client-specific interfaces are better than one general-purpose interface. Is statement of...
Interface Splitting Principle
Interface Specific Principle
Interface Segregation Principle
Interface Separation Principle
If my class implements an interface with some methods it doesn't use
Those methods should be given an empty implementation
Those methods must be given some implementation
The class needs to be defined as abstract
The interface should be split
Dependency Inversion is all about
Splitting interfaces
Adding an abstraction layer
Assisting dependent classes
Creating abstractions that depend on details
SOLID is a what?
a set of coding guidelines
a type of class diagram
a set of design principles
a software framework
_____ defines how the elements within an module work together.
Modularity
Connectivity
Teamwork
Cohesion
What is the difference between SOLID and OOP?
SOLID is a framework; OOP are concepts.
SOLID is a specific diagram that describes OOP.
OOP is a specific diagram that describes SOLID.
SOLID are design principles; OOP are concepts.
What is coupling?
Coming together of variables
Dependency of class/modules on each other
Stickiness of a class and its methods
Common services
Which is good?
Low Cohesion & Low Coupling
High Cohesion & Low Coupling
Low Cohesion & High Coupling
High Cohesion & High Coupling
