<?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: Initializing Java Maps</title>
	<atom:link href="http://torrez.us/archives/2008/03/08/560/feed/" rel="self" type="application/rss+xml" />
	<link>http://torrez.us/archives/2008/03/08/560/</link>
	<description>Hi.</description>
	<lastBuildDate>Fri, 02 Mar 2012 05:57:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Daniel</title>
		<link>http://torrez.us/archives/2008/03/08/560/comment-page-1/#comment-223945</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 28 Feb 2011 10:05:24 +0000</pubDate>
		<guid isPermaLink="false">http://torrez.us/archives/2008/03/08/560/#comment-223945</guid>
		<description>Javas Double Brace Instatiation makes it a lot easier to read your source code. For review reasons is that important to you and your colleagues. I think most people only see these advantages if nobody uses them: they would be glad to have them.

A few tips and backgrounds, too: is is about the obstacles and the possibillities with Javas Double Brace Instatiation:
http://bit.ly/endUIi

I hope I could help a little.</description>
		<content:encoded><![CDATA[Javas Double Brace Instatiation makes it a lot easier to read your source code. For review reasons is that important to you and your colleagues. I think most people only see these advantages if nobody uses them: they would be glad to have them.<br />
<br />
A few tips and backgrounds, too: is is about the obstacles and the possibillities with Javas Double Brace Instatiation:<br />
<a href="http://bit.ly/endUIi" rel="nofollow">http://bit.ly/endUIi</a><br />
<br />
I hope I could help a little.]]></content:encoded>
	</item>
	<item>
		<title>By: thrut</title>
		<link>http://torrez.us/archives/2008/03/08/560/comment-page-1/#comment-220978</link>
		<dc:creator>thrut</dc:creator>
		<pubDate>Fri, 20 Nov 2009 07:45:35 +0000</pubDate>
		<guid isPermaLink="false">http://torrez.us/archives/2008/03/08/560/#comment-220978</guid>
		<description>网络广告软件求代理QQ:1261359006、网络推广软件征代理、信息发布软件征
代理、网络营销软件征代理、论坛发布软件征代理、博客群发软件求代理、软件
合作、网络营销软件合作、名录搜索软件征代理、企业名录搜集软件征代理</description>
		<content:encoded><![CDATA[网络广告软件求代理QQ:1261359006、网络推广软件征代理、信息发布软件征<br />
代理、网络营销软件征代理、论坛发布软件征代理、博客群发软件求代理、软件<br />
合作、网络营销软件合作、名录搜索软件征代理、企业名录搜集软件征代理]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://torrez.us/archives/2008/03/08/560/comment-page-1/#comment-220965</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Wed, 18 Nov 2009 12:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://torrez.us/archives/2008/03/08/560/#comment-220965</guid>
		<description>Great example, thanks for it!

I just recently came across another example of this kind of initialization.  JMock uses this same kind of initializer pattern to create mock objects; its documentation calls it &quot;double brace&quot; notation.

Generally, this is a way to create a simple &quot;DSL&quot; (domain specific language) - define a class with a bunch of useful methods, create a new default instance, and then any of the methods can be called within the &quot;double braces&quot; - like the add() method above.  It&#039;s like defining a little mini-script within Java.  At the end of the double braces, the object you just created carries the results of the method calls - in this case, a HashMap has been populated, but any kind of data could be added.</description>
		<content:encoded><![CDATA[Great example, thanks for it!<br />
<br />
I just recently came across another example of this kind of initialization.  JMock uses this same kind of initializer pattern to create mock objects; its documentation calls it &#8220;double brace&#8221; notation.<br />
<br />
Generally, this is a way to create a simple &#8220;DSL&#8221; (domain specific language) &#8211; define a class with a bunch of useful methods, create a new default instance, and then any of the methods can be called within the &#8220;double braces&#8221; &#8211; like the add() method above.  It&#8217;s like defining a little mini-script within Java.  At the end of the double braces, the object you just created carries the results of the method calls &#8211; in this case, a HashMap has been populated, but any kind of data could be added.]]></content:encoded>
	</item>
	<item>
		<title>By: Jay K</title>
		<link>http://torrez.us/archives/2008/03/08/560/comment-page-1/#comment-218371</link>
		<dc:creator>Jay K</dc:creator>
		<pubDate>Thu, 16 Apr 2009 03:44:25 +0000</pubDate>
		<guid isPermaLink="false">http://torrez.us/archives/2008/03/08/560/#comment-218371</guid>
		<description>wonderful article, helped me a lot.

found the same deal somehow at this link too:
http://www.java2s.com/Code/Java/Collections-Data-Structure/UsingtheDoubleBraceInitialization.htm</description>
		<content:encoded><![CDATA[wonderful article, helped me a lot.<br />
<br />
found the same deal somehow at this link too:<br />
<a href="http://www.java2s.com/Code/Java/Collections-Data-Structure/UsingtheDoubleBraceInitialization.htm" rel="nofollow">http://www.java2s.com/Code/Java/Collections-Data-Structure/UsingtheDoubleBraceInitialization.htm</a>]]></content:encoded>
	</item>
	<item>
		<title>By: Pablo</title>
		<link>http://torrez.us/archives/2008/03/08/560/comment-page-1/#comment-217699</link>
		<dc:creator>Pablo</dc:creator>
		<pubDate>Fri, 06 Feb 2009 14:29:25 +0000</pubDate>
		<guid isPermaLink="false">http://torrez.us/archives/2008/03/08/560/#comment-217699</guid>
		<description>Great, works perfect. Thanks for the post</description>
		<content:encoded><![CDATA[Great, works perfect. Thanks for the post]]></content:encoded>
	</item>
	<item>
		<title>By: Pat</title>
		<link>http://torrez.us/archives/2008/03/08/560/comment-page-1/#comment-217420</link>
		<dc:creator>Pat</dc:creator>
		<pubDate>Mon, 01 Dec 2008 17:32:41 +0000</pubDate>
		<guid isPermaLink="false">http://torrez.us/archives/2008/03/08/560/#comment-217420</guid>
		<description>Thanks for the tip.  I was looking for a way to put a Map into an enum, and couldn&#039;t figure out how to get the map initialized.  This code works much better than passing in separate key and value arrays and worrying over whether they&#039;ve gotten out of sync.</description>
		<content:encoded><![CDATA[Thanks for the tip.  I was looking for a way to put a Map into an enum, and couldn&#8217;t figure out how to get the map initialized.  This code works much better than passing in separate key and value arrays and worrying over whether they&#8217;ve gotten out of sync.]]></content:encoded>
	</item>
	<item>
		<title>By: Dor</title>
		<link>http://torrez.us/archives/2008/03/08/560/comment-page-1/#comment-215227</link>
		<dc:creator>Dor</dc:creator>
		<pubDate>Thu, 30 Oct 2008 08:44:34 +0000</pubDate>
		<guid isPermaLink="false">http://torrez.us/archives/2008/03/08/560/#comment-215227</guid>
		<description>Just what i have looked for.</description>
		<content:encoded><![CDATA[Just what i have looked for.]]></content:encoded>
	</item>
	<item>
		<title>By: Axel</title>
		<link>http://torrez.us/archives/2008/03/08/560/comment-page-1/#comment-208264</link>
		<dc:creator>Axel</dc:creator>
		<pubDate>Mon, 17 Mar 2008 09:13:38 +0000</pubDate>
		<guid isPermaLink="false">http://torrez.us/archives/2008/03/08/560/#comment-208264</guid>
		<description>I don&#039;t see how this operation is costly. You may check this with a profiler, but I would be surprised, if the second example would take &gt;1 milisecond longer than the first example on a modern PC. 
Class loading is clearly not expensive. 
On the other hand there are hidden costs: It may surprise future maintainers and its not that easy to look up the values of the hashmap in a debugger.</description>
		<content:encoded><![CDATA[I don&#8217;t see how this operation is costly. You may check this with a profiler, but I would be surprised, if the second example would take &gt;1 milisecond longer than the first example on a modern PC. <br />
Class loading is clearly not expensive. <br />
On the other hand there are hidden costs: It may surprise future maintainers and its not that easy to look up the values of the hashmap in a debugger.]]></content:encoded>
	</item>
	<item>
		<title>By: Initializing Java Maps - lekkimworld.com</title>
		<link>http://torrez.us/archives/2008/03/08/560/comment-page-1/#comment-208019</link>
		<dc:creator>Initializing Java Maps - lekkimworld.com</dc:creator>
		<pubDate>Fri, 14 Mar 2008 22:03:25 +0000</pubDate>
		<guid isPermaLink="false">http://torrez.us/archives/2008/03/08/560/#comment-208019</guid>
		<description>[...] Torres: Initializing Java Maps Tags : java   Add a comment   Posted by Mikkel Heisterberg on 14 March 2008 21:12:00 CET #         [...]</description>
		<content:encoded><![CDATA[[...] Torres: Initializing Java Maps Tags : java   Add a comment   Posted by Mikkel Heisterberg on 14 March 2008 21:12:00 CET #         [...]]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Edgar</title>
		<link>http://torrez.us/archives/2008/03/08/560/comment-page-1/#comment-207659</link>
		<dc:creator>Nick Edgar</dc:creator>
		<pubDate>Tue, 11 Mar 2008 14:35:59 +0000</pubDate>
		<guid isPermaLink="false">http://torrez.us/archives/2008/03/08/560/#comment-207659</guid>
		<description>It also has the downside of costing a class.  Class loading is expensive.</description>
		<content:encoded><![CDATA[It also has the downside of costing a class.  Class loading is expensive.]]></content:encoded>
	</item>
</channel>
</rss>

