Joined June 2014
·

Kasper B. Graversen

Architect at Edlund A/S
·
Denmark
·
·

Posted to Don't use static over 1 year ago

What would the purpose be for you to make a class singleton? If you need singleton behaviour your are better off using a DI framework and configuring the instance as singleton in the registration part of the DI.

Posted to Don't use static over 1 year ago

Thanks for your feedback. DI is an interesting choice. In fact the modern DI containers such as AutoFac has the notion of scoped dependency configurations and thus the configuration is by no means static. Rather it is instance-based. I'll update the text with an example.

Posted to Don't use static over 1 year ago

What do you mean intelligently?please give some examples.

Achievements
47 Karma
3,486 Total ProTip Views
Interests & Skills