All Questions
3 questions
0
votes
1
answer
128
views
Is it bad practice to simplify constructor dependencies using a simple container when the class represents the entry point for a sub system?
I have a System which depends on Transactions, and a few other things. This list can become very long. Transactions can be (and will be) implemented in two ways or more, so every transaction is an ...
3
votes
5
answers
16k
views
Constructor overloading or allow null?
Which is the preferred design to use, one constructor that allows null, or two constructors where one throws an ArgumentNullException on null?
Two constructors with exception throwing
public class ...
27
votes
4
answers
10k
views
Legitimate "real work" in a constructor?
I am working on a design, but keep hitting a roadblock. I have a particular class (ModelDef) that is essentially the owner of a complex node tree built by parsing an XML schema (think DOM). I want to ...