All Questions
Tagged with builder-pattern constructors
4 questions
3
votes
3
answers
471
views
How to efficiently build objects without default constructors
I am trying to explain and understand a way to create object which cannot have "default" instances. Typically I want classes which represent, as closely as possible, the real-life concept I ...
6
votes
1
answer
1k
views
Approach for Constructing View Models in Complex MVVM Application
I'm struggling with the design in a WPF MVVM application. In a few courses I've taken, they say that having a lot of parameters in a constructor is a code smell, but they never address how to deal ...
27
votes
3
answers
30k
views
Constructor with tons of parameters vs builder pattern
It is well know that if your class have a constructor with many parameters, say more than 4, then it is most probably a code smell. You need to reconsider if the class satisfies SRP.
But what if we ...
8
votes
3
answers
6k
views
How to deal with constructors in large data classes [duplicate]
Several times now I have come across the situations where you have some kind of settings class that simply contains a mass of data. Often these classes are simply not valid without at least most of ...