Comment 9 for bug 1461200

Revision history for this message
Brian Curtin (brian.curtin) wrote :

Qiming: from the last points in your last message, while your one particular example isn't greatly improved within the scope of that particular resource, bringing consistency across the board to all other resources and services is what we really need to be mindful of. We currently have a mix of things like `foo = resource.prop("foo", type=foo.Foo)`, `foo = resource.prop("foo_id")`, and `foo_id = resource.prop("foo")` -- with what we've seen of the type=foo.Foo not being workable, we need to converge on one way to call properties that contain identifiers.

I pretty strongly believe that at this point, anything that contains IDs should be named as the following:
- A single ID value should be the singular name of the property with an "_id" suffix.
- Any sequence or collection of ID values should be the singular name of the property with an "_ids" suffix. This form includes lists, dicts, lists of dicts, dicts of lists, etc.

Adding _id/_ids suffixes to the names should bring a more readable and understandable set of properties without having to resort to the documentation. Of course it's no excuse for under-documenting things, but now that we're not going to have the properties be Resources themselves, I think there is now value to identifying those properties more explicitly.