Namespacing Models

0 views
Skip to first unread message

Neville

unread,
Apr 11, 2008, 2:32:47 AM4/11/08
to Jester JS
Hi,

Firstly, Jester is awesome, thanks - I hope to replace my homegrown
RESTful api with Jester.

One issue I face is namespacing the Jester models, so they dont end up
in the global object, ie, instead of writing

Resource.model("Post") ;

to get a global Post object, I woud like to write something like

MyNamespace.Post = Resource.model("Post");

or perhaps

Resource.model("Post", MyNamespace);

Of course, the restful URIs are unchanged by this namespacing on the
client.

Any comments welcome.

Nev




Eric Mill

unread,
Apr 11, 2008, 2:06:22 PM4/11/08
to jest...@googlegroups.com
Hi Neville,

Do you find any problems with setting up the namespace yourself? Like:

Resource.model("Post");
MyNamespace.Post = Post;
Post = null;

I haven't tried it, but thinking about it, I bet it would cause
problems, when really it shouldn't. If you find bugs resulting from
this behavior, would you mind creating an issue at the Google Code page
for Jester?

http://code.google.com/p/jester-js/

Thanks,
Eric

Reply all
Reply to author
Forward
0 new messages