Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

reduce limitations #7

@Andersmholmgren

Description

@Andersmholmgren

The limitations listed in the transformation doco effectively render it useless for me. I very often have multiple constructors, use inheritance and have mostly immutable classes where the constructors contain some logic.

Are there any plans to improve this? In particular, provide a way to specify the constructors to use. One way is via annotations. Another would be to allow defaults to be specified. e.g. default to always calling the unnamed constructor, or a constructor called say 'build'.

FYI I do support such features in shelf_bind and it wasn't overly complex from memory, but that was with mirrors - I haven't tried transformers yet - maybe that is trickier?

Limitations
Note that this is quite limited. It does not handle inheritance at all. If constructors have parameters which are not of the form "this.field", those will always be passed as null. It will always use the constructor with the fewest parameters. It does handle getter/setter pairs and getters or fields which correspond to constructor parameters. It will probably not work with part files, and it expects all the classes that will be serialized to be listed in those files.

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