<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Pseudo-RESTful</title>
	<atom:link href="http://blog.medryx.org/2008/06/18/pseudo-restful/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.medryx.org/2008/06/18/pseudo-restful/</link>
	<description>Observations of a physician software developer.</description>
	<pubDate>Wed, 08 Sep 2010 08:26:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: maulin</title>
		<link>http://blog.medryx.org/2008/06/18/pseudo-restful/#comment-9</link>
		<dc:creator>maulin</dc:creator>
		<pubDate>Thu, 19 Jun 2008 04:35:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/?p=18#comment-9</guid>
		<description>Ugh. Yes. That is EXACTLY what I meant. I guess I didn't understand this as thoroughly as I had hoped. I have created a slightly different approach to this, but now seeing how JsonRestStore is setup, I don't know how much value add there is. We'll see. I plan on posting about it later tonight. 

thanks again for your input.

-maulin</description>
		<content:encoded><![CDATA[<p>Ugh. Yes. That is EXACTLY what I meant. I guess I didn&#8217;t understand this as thoroughly as I had hoped. I have created a slightly different approach to this, but now seeing how JsonRestStore is setup, I don&#8217;t know how much value add there is. We&#8217;ll see. I plan on posting about it later tonight. </p>
<p>thanks again for your input.</p>
<p>-maulin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Zyp</title>
		<link>http://blog.medryx.org/2008/06/18/pseudo-restful/#comment-8</link>
		<dc:creator>Kris Zyp</dc:creator>
		<pubDate>Thu, 19 Jun 2008 04:28:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/?p=18#comment-8</guid>
		<description>Maulin,
I am not exactly certain what you mean by entity-manager, are you referring to the mechanism for triggering lazy loads on property access and recording property changes? I am not sure how you would like JsonRestStore split up. Here is the current breakdown of modules:
JsonRestStore - Dojo Data API adapter
JsonRest - Tracks changes and fires Rest services
Rest - Remote communication service provider
dojox.json.ref - Referencing manager for lazy loading and other forms of referencing
Perhaps JsonRest or JsonRestStore would roughly correspond to your "entity-manager", and the Rest service would correspond to your "persister", not sure. You can definitely plug your own custom Rest service into JsonRestStore. It looks like:
myService = function(id){ ... get data ... }
myService.put = function(content) { ... save data ...}
myService.post = function(target,content) { .. create new object ...}
myService['delete'] = function(target){ ... delete object ...}

If you providing getters and setters is what you have in mind for an entity-manager, you can also define schemas for JsonRestStore that define the prototype to use for the objects in the store:
mySchema = {
  prototype: {
    getFoo:function(){return this.foo},
    setFoo:function(val){this.foo =val}
  }
}
myStore = new JsonRestStore({service:myService,schema:mySchema});</description>
		<content:encoded><![CDATA[<p>Maulin,<br />
I am not exactly certain what you mean by entity-manager, are you referring to the mechanism for triggering lazy loads on property access and recording property changes? I am not sure how you would like JsonRestStore split up. Here is the current breakdown of modules:<br />
JsonRestStore - Dojo Data API adapter<br />
JsonRest - Tracks changes and fires Rest services<br />
Rest - Remote communication service provider<br />
dojox.json.ref - Referencing manager for lazy loading and other forms of referencing<br />
Perhaps JsonRest or JsonRestStore would roughly correspond to your &#8220;entity-manager&#8221;, and the Rest service would correspond to your &#8220;persister&#8221;, not sure. You can definitely plug your own custom Rest service into JsonRestStore. It looks like:<br />
myService = function(id){ &#8230; get data &#8230; }<br />
myService.put = function(content) { &#8230; save data &#8230;}<br />
myService.post = function(target,content) { .. create new object &#8230;}<br />
myService['delete'] = function(target){ &#8230; delete object &#8230;}</p>
<p>If you providing getters and setters is what you have in mind for an entity-manager, you can also define schemas for JsonRestStore that define the prototype to use for the objects in the store:<br />
mySchema = {<br />
  prototype: {<br />
    getFoo:function(){return this.foo},<br />
    setFoo:function(val){this.foo =val}<br />
  }<br />
}<br />
myStore = new JsonRestStore({service:myService,schema:mySchema});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: maulin</title>
		<link>http://blog.medryx.org/2008/06/18/pseudo-restful/#comment-7</link>
		<dc:creator>maulin</dc:creator>
		<pubDate>Wed, 18 Jun 2008 17:29:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/?p=18#comment-7</guid>
		<description>great idea. thanks. 

I actually thought about this "hack" some more, and had a more general thought: The reason I like JsonRestStore is that it has a VERY nice entity-manager (for lack of a better term). Its not that I need or want REST (I have a simple working RPC server already working with get/save/delete methods). 

I think the JsonRestStore actually has mixed concerns -- on the one hand an entity-manager, and on the other a "persister". Perhaps we could think about how to split the two, and then make REST a pluggable persister into the entity-manager?</description>
		<content:encoded><![CDATA[<p>great idea. thanks. </p>
<p>I actually thought about this &#8220;hack&#8221; some more, and had a more general thought: The reason I like JsonRestStore is that it has a VERY nice entity-manager (for lack of a better term). Its not that I need or want REST (I have a simple working RPC server already working with get/save/delete methods). </p>
<p>I think the JsonRestStore actually has mixed concerns &#8212; on the one hand an entity-manager, and on the other a &#8220;persister&#8221;. Perhaps we could think about how to split the two, and then make REST a pluggable persister into the entity-manager?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Zyp</title>
		<link>http://blog.medryx.org/2008/06/18/pseudo-restful/#comment-6</link>
		<dc:creator>Kris Zyp</dc:creator>
		<pubDate>Wed, 18 Jun 2008 15:56:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/?p=18#comment-6</guid>
		<description>May I suggest something like this for REST blocking servers:

var defaultXhr = dojo.xhr;
dojo.xhr = function(method,args,hasBody){
  if(method!="GET"){
     args.url += (args.url.indexOf('?') &#62; 0 ? "&#38;" : "?" ) + "action=" + method.toLowerCase();
     if(method=="PUT"){
        args.postData = args.putData;
     }
     method = "POST";
  }
  return defaultXhr(method,args,hasBody);
}

That way all your requests that use PUT, POST, and DELETE will automatically have the correct "action" parameter. I didn't test this, but I think it should work.</description>
		<content:encoded><![CDATA[<p>May I suggest something like this for REST blocking servers:</p>
<p>var defaultXhr = dojo.xhr;<br />
dojo.xhr = function(method,args,hasBody){<br />
  if(method!=&#8221;GET&#8221;){<br />
     args.url += (args.url.indexOf(&#8217;?') &gt; 0 ? &#8220;&amp;&#8221; : &#8220;?&#8221; ) + &#8220;action=&#8221; + method.toLowerCase();<br />
     if(method==&#8221;PUT&#8221;){<br />
        args.postData = args.putData;<br />
     }<br />
     method = &#8220;POST&#8221;;<br />
  }<br />
  return defaultXhr(method,args,hasBody);<br />
}</p>
<p>That way all your requests that use PUT, POST, and DELETE will automatically have the correct &#8220;action&#8221; parameter. I didn&#8217;t test this, but I think it should work.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
