I am working on a PR to support a FluentImmutableBuilder class.
I am a bit unsure about the behavior when it is maybe not the best choice.
When could use FluentBuilder
When the FluentBuilder encounters no parameterless constructor it throws an error and tells the user to override the NewInstance method. There is some symmetry in then throwing if there is no constructor that takes arguments.
So should we throw a descriptive error message here?
New type
Maybe it would be better to add this as a configuration on FluentBuilder. Like .UseConstructorWithMostArguments() and UseConstructorOf(Type[])
Do we indeed need a new type or should it be added to existing class?
Property behavior
If new type, should it try set properties or just use constructor?
I am working on a PR to support a
FluentImmutableBuilderclass.I am a bit unsure about the behavior when it is maybe not the best choice.
When could use FluentBuilder
When the
FluentBuilderencounters no parameterless constructor it throws an error and tells the user to override theNewInstancemethod. There is some symmetry in then throwing if there is no constructor that takes arguments.So should we throw a descriptive error message here?
New type
Maybe it would be better to add this as a configuration on
FluentBuilder. Like.UseConstructorWithMostArguments()andUseConstructorOf(Type[])Do we indeed need a new type or should it be added to existing class?
Property behavior
If new type, should it try set properties or just use constructor?