WilkinsonK / xapi-oxidized

XNAT web API client
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Define From or Into `URIBuilder` implementations for models #30

Open WilkinsonK opened 2 months ago

WilkinsonK commented 2 months ago

As a developer using this library, both in core implementation and externally from other projects, I would like to simplify the usage of building URI paths from a model, if there is a common path available to me from that model.

As an explanation, during the development of CRUD operations, I began to notice an over-usage of the same patterns that would appear inescapable. There's been no clear way to unify these behaviors without some additional work, besides taking a build pattern and directly constructing a URI string. This being said, perhaps we need some interface (trait) that can be leveraged to unify this idea. ToString or Display is no good as we need these for either debugging purposes already or to display the entire body of an individual model when not all properties are used to construct a URI. We could instead implement Into for From but this could also be potentially confusing to the downstream user.

Some consideration is in order for what this trait must be.