Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RepresentationReader should return mutable Representation #9

Open
lathspell opened this issue Aug 4, 2014 · 1 comment
Open

RepresentationReader should return mutable Representation #9

lathspell opened this issue Aug 4, 2014 · 1 comment
Milestone

Comments

@lathspell
Copy link

Some APIs return the current state of an object so that the user can change some properties and then send the whole object back to server.

This use case seems to be impossible with HalBuilder as the RepresentationReader API only returns a ReadableRepresentation and there is no way to convert that to a modifyable Representation.

(of course I could copy all links, namespaces, properties and resources but that should be hidden in the API)

The issue seems to be easy fixable as Representation is a subclass of ReadableRepresentation so backwards compatibility is given. Also the returned object is explicitly converted from Representation to ImmutableRepresentation in JsonRepresentationReader's read() method so it would be enough to skip that step.

@talios
Copy link
Member

talios commented Jul 19, 2015

Finally getting around to looking at this issue, I'm currently leaning towards dropping both ImmutableRepresentation and MutableRepresentation in favour of something like a PersistentRepresentation - part of this would be switching to use TotallyLazy's PersistentMaps/PersistentLists for internal collections ( I might need to write my own PersistentMultimap as well ).

Each withXXX call would return a new PersistentRepresentation with the relevant changes.

@talios talios added this to the 4.1 Release milestone Jul 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants