Skip to content

Support building of immutable objects #12

@dburriss

Description

@dburriss

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplannedissue is planned for a future release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions