<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Services.jsm</title>
	<atom:link href="http://www.gavinsharp.com/blog/2010/02/25/services-jsm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gavinsharp.com/blog/2010/02/25/services-jsm/</link>
	<description>blog?</description>
	<lastBuildDate>Mon, 03 Oct 2011 17:34:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Taras&#8217; Blog &#187; Blog Archive &#187; mozilla::services</title>
		<link>http://www.gavinsharp.com/blog/2010/02/25/services-jsm/comment-page-1/#comment-824</link>
		<dc:creator>Taras&#8217; Blog &#187; Blog Archive &#187; mozilla::services</dc:creator>
		<pubDate>Tue, 20 Apr 2010 19:20:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.gavinsharp.com/blog/?p=37#comment-824</guid>
		<description>[...] landed the mozilla::services bug around the same time as Gavin announced the Services.jsm equivalent. Services.jsm came a pleasant surprise to me, it&#8217;s nice to have [...]</description>
		<content:encoded><![CDATA[<p>[...] landed the mozilla::services bug around the same time as Gavin announced the Services.jsm equivalent. Services.jsm came a pleasant surprise to me, it&#8217;s nice to have [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gavin&#8217;s blog &#187; browser.js cleanup ideas</title>
		<link>http://www.gavinsharp.com/blog/2010/02/25/services-jsm/comment-page-1/#comment-760</link>
		<dc:creator>Gavin&#8217;s blog &#187; browser.js cleanup ideas</dc:creator>
		<pubDate>Tue, 30 Mar 2010 14:01:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.gavinsharp.com/blog/?p=37#comment-760</guid>
		<description>[...] it up has been brought up several times in the past. We have made some changes that help &#8211; Services.jsm landed recently and helps reduce some of the XPCOM boilerplate overhead (though there&#8217;s a [...]</description>
		<content:encoded><![CDATA[<p>[...] it up has been brought up several times in the past. We have made some changes that help &#8211; Services.jsm landed recently and helps reduce some of the XPCOM boilerplate overhead (though there&#8217;s a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Home of KaiRo: Weekly Status Report, W08/2010</title>
		<link>http://www.gavinsharp.com/blog/2010/02/25/services-jsm/comment-page-1/#comment-741</link>
		<dc:creator>Home of KaiRo: Weekly Status Report, W08/2010</dc:creator>
		<pubDate>Mon, 01 Mar 2010 16:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.gavinsharp.com/blog/?p=37#comment-741</guid>
		<description>[...] pass of that but needs some answers from places developers as well to get in.Services.jsm: Gavin introduced Services.jsm to toolkit this week, and as I think this is a very welcome improvement for reducing code [...]</description>
		<content:encoded><![CDATA[<p>[...] pass of that but needs some answers from places developers as well to get in.Services.jsm: Gavin introduced Services.jsm to toolkit this week, and as I think this is a very welcome improvement for reducing code [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AndersH</title>
		<link>http://www.gavinsharp.com/blog/2010/02/25/services-jsm/comment-page-1/#comment-738</link>
		<dc:creator>AndersH</dc:creator>
		<pubDate>Sat, 27 Feb 2010 19:23:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.gavinsharp.com/blog/?p=37#comment-738</guid>
		<description>Sorry, I overlooked the &quot;appshell&quot; part. And doing something like ...appshell$windowMediator() will probably be to long.</description>
		<content:encoded><![CDATA[<p>Sorry, I overlooked the &#8220;appshell&#8221; part. And doing something like &#8230;appshell$windowMediator() will probably be to long.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AndersH</title>
		<link>http://www.gavinsharp.com/blog/2010/02/25/services-jsm/comment-page-1/#comment-733</link>
		<dc:creator>AndersH</dc:creator>
		<pubDate>Sat, 27 Feb 2010 07:37:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.gavinsharp.com/blog/?p=37#comment-733</guid>
		<description>Would it be silly to use something like __noSuchMethod__ to add the shorthand for all (or most) classes at once. Also this way the new names are guessable and documented since they are the same as the old. Pseudo-code (I hope it doesn&#039;t turn up to garbled):

var Services = {
  __noSuchMethod__: function(id, args) {
  	var cName = id.replace(/([A-Z])/, &quot;-$1&quot;).toLowerCase();
  	var iName = &quot;nsI&quot; + id.substring(0, 1).toUpperCase() + id.substring(1);
  	var c = Components.classes[&#039;@mozilla.org/appshell/&quot; + cName + &quot;;1&#039;];
  	var i = Components.interfaces[iName];
  	return c.getService(i);
  }
}

function getTopWin() {
  return Services.windowMediator().getMostRecentWindow(&quot;navigator:browser&quot;);
}</description>
		<content:encoded><![CDATA[<p>Would it be silly to use something like __noSuchMethod__ to add the shorthand for all (or most) classes at once. Also this way the new names are guessable and documented since they are the same as the old. Pseudo-code (I hope it doesn&#8217;t turn up to garbled):</p>
<p>var Services = {<br />
  __noSuchMethod__: function(id, args) {<br />
  	var cName = id.replace(/([A-Z])/, &#8220;-$1&#8243;).toLowerCase();<br />
  	var iName = &#8220;nsI&#8221; + id.substring(0, 1).toUpperCase() + id.substring(1);<br />
  	var c = Components.classes['@mozilla.org/appshell/" + cName + ";1'];<br />
  	var i = Components.interfaces[iName];<br />
  	return c.getService(i);<br />
  }<br />
}</p>
<p>function getTopWin() {<br />
  return Services.windowMediator().getMostRecentWindow(&#8220;navigator:browser&#8221;);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Kaiser</title>
		<link>http://www.gavinsharp.com/blog/2010/02/25/services-jsm/comment-page-1/#comment-728</link>
		<dc:creator>Robert Kaiser</dc:creator>
		<pubDate>Fri, 26 Feb 2010 13:28:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.gavinsharp.com/blog/?p=37#comment-728</guid>
		<description>Gavin already knows, but for any other readers I&#039;d like to point out that 1) this is in toolkit so any Mozilla application can use it and 2) https://bugzilla.mozilla.org/show_bug.cgi?id=548715 is working on starting to use it in SeaMonkey.</description>
		<content:encoded><![CDATA[<p>Gavin already knows, but for any other readers I&#8217;d like to point out that 1) this is in toolkit so any Mozilla application can use it and 2) <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=548715" rel="nofollow">https://bugzilla.mozilla.org/show_bug.cgi?id=548715</a> is working on starting to use it in SeaMonkey.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: glandium</title>
		<link>http://www.gavinsharp.com/blog/2010/02/25/services-jsm/comment-page-1/#comment-726</link>
		<dc:creator>glandium</dc:creator>
		<pubDate>Thu, 25 Feb 2010 21:23:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.gavinsharp.com/blog/?p=37#comment-726</guid>
		<description>Finally ! ;)</description>
		<content:encoded><![CDATA[<p>Finally ! <img src='http://www.gavinsharp.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

