Questions
Let’s take a look at a few practice questions:
- Why is the Strategy pattern a behavioral pattern?
- What is the goal of creational patterns?
- If I write the code
public MyType MyProp => new MyType();
and I call the property twice (var v1 = MyProp; var v2 = MyProp;
), arev1
andv2
the same instance or two different instances? - Is it true that the Abstract Factory pattern allows us to add new families of elements without modifying the existing consuming code?
- Why is the Singleton pattern an anti-pattern?