Skip to content

Private / public constructors in DTO coherence #9

@darkspock

Description

@darkspock

In the example PostCheepCommand, you use a private constructor, in SignUpCommand a public constructor, later a named constructor.
I know the reader should know the difference and when to use it, but is confusing to follow the examples this way.
I think should explain the benefits and tradeoff of fromArray, because in the example is contrary to the phrase in the same chapter "It will also add type safety and IDE assistance, too."

Filling from array is not type safety and the IDE can not help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions