All Questions
Tagged with initialization design-patterns
2 questions
2
votes
3
answers
247
views
What options are there to handle dependencies that may error?
I have an application, which contains a logger. The logger already exists and is ready to be used, so it can be passed directly to the constructor.
class App {
private readonly logger: Logger;
...
1
vote
2
answers
696
views
Is it a good idea having default static variables for new instances?
OK let's say I have something like this:
public class MyObject {
public static int DefaultValue = 9
private int _value = DefaultValue;
public int Value { get { return _value; } set { ...