Open richardpawson opened 11 years ago
I wrote " (for a non-addressable view model - not encouraged)". But thinking on this, if we were to get rid of (non-addressable) proto-persistent objects, we should get rid of non-addressable view models also, in the same way!
Just for clarification, the changes I am proposing (or thinking of proposing) are:
For RO 2.0, I think it would be worth considering changing the approach to proto-persistent objects - bringing them more into line with addressable view models (which should also be brought properly into the next release of the spec, whether 1.1 or 2.0).
I am suggesting that even proto-persistent objects would be properly addressable. One possibility would be to give them a clearly distinct form of Id e.g.:
objects/customers/transient
or even
objects/customers/0 (since persistent integer Ids typically start from 1)
N.B. there is no need to distinguish two different transient instances.
Arguably, this is not then a spec. issue - it is up to the implementation to determine how to distinguish a persistent from a proto-persistent object. However there would still need to be:
Arguably, the existence of a 'persist' link could serve both purposes. Upon calling this link, an object of the same type but with a real (persistent) Id would be returned and it would have an update link rather than a persist link.
This just means changing the spec to say that an object representation may have a 'persist' link OR an 'update' link - or neither (for a non-addressable view model - not encouraged), but never both.