C
C#3y ago
Hulkstance

Builder pattern question

I have a Builder pattern for the options and since domainName and domainContainer are mandatory fields, I wonder if it's actually better to create WithXYZ methods for each one of them and have a string.IsNullOrEmpty check in Build() in opposed to setting them in the ctor
4 Replies
Hulkstance
HulkstanceOP3y ago
basically this one or
Hulkstance
HulkstanceOP3y ago
which one would you rather choose?

Did you find this page helpful?