SOLID
DI Patterns
Refactoring.Guru
Vue
C# Design Patterns
100

There should never be more than one reason for a class to change

What is Single Responsibility Principle?

100

Dependency injection separates the creation of a client's dependencies from the client's behavior, which allows program designs to be loosely coupled and to follow the ____________ and ___________ principles.

Dependency Inversion and Single Responsibility

100

The metaphor of  _________ in regards to unclean code was originally suggested by Ward Cunningham.

What is Technical Dept?

100

_________ are special attributes with the v- prefix.  Their job is to reactively apply side effects to the DOM when the value of its expression changes.  (see the following emboldened text for a code example)

<img v-for="item in items" />
<span v-if="canShowSpan" />
<template v-slot:header />

What is a Directive?

100

C# Design Patterns are generalized into what 3 categories.

What are Creation, Structural and Behavior Patterns?

200

Software entities (i.e Classes, Modules, Functions, ect) should be open for extension, but closed for modifications.

What is Open-Closed Principle?

200

Dependency injection involves these four roles.

What is service, client, interface and injector roles?

200

This term describes the number of times code can be repeated before it should be refactored.

What is the Rule of Three?

200

This Vue feature allows you to add and remove CSS classes based on a boolean view-model property.  It also allows you to bind inline style values to a view model.

What is Class and Style Bindings?

200

This creation pattern lets you ensure that a class has only one instance.  It also provides a global access point to this instance. 

What is Singleton Pattern?

300

Applying this principle means decomposing "fat" interfaces into simpler units-of-works so that a class is not forced to implement what it does not need.

What is Interface Segregation Principle?

300

An object that is depending on the service(s) it uses

What is client role.

300

_________ is a systematic process of improving code without creating new functionality and can transform a mess into clean code and simple design.

What is Refactoring?

300

This Vue feature provides the following capabilities

1) its value is cached and based on its reactive dependencies
2) immediately returns the previous results without having to re-run the evaluation code again
3) automatically re-evaluates its value when one or more of its dependencies change

What are Computed Properties?

300

This creation pattern lets you copy an existing object without making your code depend on its class (or classes).  

What is Prototype Pattern?

400

Applying this principle prevents the following Bad Design issues:

1. Rigidity: changing causes too many cascade changes 

2. Fragility: changes cause unexpected system breakage

3. Immobility: you cannot port the code because of entanglement

What is Dependency Inversion Principle?

400

This role defines how a client may use the service(s)

What is Interface role?

400

Name 4 of the ten reasons for Technical Dept.

1)  Business pressure
2)  Delayed refactoring
3)  Failing to combat the strict coherence of components
4)  Incompetence
5)  Lack of understanding of the consequences of technical debt
6)  Long-term simultaneous development in several branches
7)  No Compliance Monitoring (AKA Code Review)
8)  No Documentation
9)  No Team Communication/Interaction
10) No Tests


400

This directive is responsible attaching and event to a method on your Vue instance.

What is the v-on directive?

400

This creation pattern uses factory methods to create objects without having to specify exact classes.


class BaseFactory { virtual IButton CreateButton(); }

class WPFFactory : BaseFactory { override IButton CreateButton() => return new WPFButton(); }

class VueFactory : BaseFactory { override IButton CreateButton() => return new VButton(); }

What is Factory Pattern?

500

This method is a clear violation of this key principle.

void DrawShape(Shape s)
{
    if (s.GetType() == typeof(Square))
        DrawSquare(s);
    else if (s.GetType() == typeof(Circle))
        DrawCircle(s);
}

What is Liskov Substitution Principle?
500

Daily Double

The intent behind dependency injection is to achieve __________ concerning the construction and use of objects; which increases readability and code reuse.

What is Separation of Concerns

500

Bloaters, Object-Orientation Abusers, Change Preventers, Dispensable and Couplers are the 5 categories of what refactoring term?

What is Code Smell?
500

Daily Double

By default the v-model directive syncs the input upon each 'input' event.  Using this modifier would cause the sync to occur after the 'change' event.

What is the lazy modifier?

500

This creation pattern lets you produce families of related objects without specifying their concrete classes.  It leverages another creation pattern that is similarly named.

What is Abstract Factory Pattern?

M
e
n
u