[LRUG] Naming...
Paul Doerwald
paul at liquidmedia.ca
Tue May 22 02:15:10 PDT 2007
I'm not clear how or why you would use this? I'm interested to get in
your head on this, as it's a problem I've wondered about in the past
(although not quite in a REST context).
Paul.
On 21-May-07, at 7:38 PM, Jonathan Leighton wrote:
> Hey all,
>
> I'm working on a Rails plugin called "Restflection" which provides
> reflection for resources (I know, the name's cheesy ;). In other
> words,
> you can get the resource/url/path/whatever without knowing it is an
> "account" as opposed to an "article". I am struggling a bit with
> deciding how to expose it. I don't want to pollute the namespace by
> providing a load of methods in the controller/view, so I was thinking
> along these lines:
>
> Singular:
>
> resource_reflection.resource -> @account
> resource_reflection.resource= -> @account=
> resource_reflection.name -> "account"
> ...
>
> Plural:
>
> resources_reflection.resources -> @accounts
> resources_reflection.resources= -> @accounts=
> resources_reflection.name -> "accounts"
> ...
>
> But what do you think of this?
>
> Singular:
>
> restflect(:member).it
> restflect(:member).it = "Foo"
> restflect(:member).name
>
> Plural:
>
> restflect(:collection).it
> restflect(:collection).it = ["Foo", "Bar]
> restflect(:collection).name
>
> My main problem is exposing the actual @account(s) object -
> "resource(s)" is repetition but "it" doesn't seem very descriptive. I
> think maybe I like the latter better though.
>
> Cheers
>
> Jon
>
> _______________________________________________
> chat mailing list
> chat at lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
More information about the Chat
mailing list