<?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: Anti-patterns in Code: Ubiquitous HashMap</title>
	<atom:link href="http://www.pathf.com/blogs/2008/03/anti-patterns-i/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pathf.com/blogs/2008/03/anti-patterns-i/</link>
	<description>Running commentary about agile development, user experience design and Ajax.</description>
	<pubDate>Thu, 08 Jan 2009 19:05:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: WarpedJavaGuy</title>
		<link>http://www.pathf.com/blogs/2008/03/anti-patterns-i/#comment-87</link>
		<dc:creator>WarpedJavaGuy</dc:creator>
		<pubDate>Wed, 05 Mar 2008 04:56:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=68#comment-87</guid>
		<description>&lt;p&gt;a.k.a. The Kitchen Sink Design Pattern&lt;/p&gt;

&lt;p&gt;Problem:&lt;br /&gt;
The data requirements keep changing but the interface must remain constant.&lt;/p&gt;

&lt;p&gt;Solution:&lt;br /&gt;
1. Create a kitchen sink for storing an unlimited number of objects of any type&lt;br /&gt;
2. Create one interface with one method that accepts and returns the kitchen sink&lt;br /&gt;
3. Implement the same interface in all services and across all layers everywhere&lt;/p&gt;

&lt;p&gt;Strategy:&lt;br /&gt;
Implement the kitchen sink using a HashMap.&lt;/p&gt;

&lt;p&gt;Forces:&lt;br /&gt;
When the domain model does not matter and you just want quick and dirty access to any data from anywhere.&lt;/p&gt;

&lt;p&gt;Pros:&lt;br /&gt;
- The interface will never change&lt;br /&gt;
- The kitchen sink can never be full&lt;/p&gt;

&lt;p&gt;Cons:&lt;br /&gt;
- Can grow very large&lt;br /&gt;
- Serialization can be expensive&lt;br /&gt;
- Synchronization can become unmanageable&lt;br /&gt;
- Data can become volatile&lt;br /&gt;
- Can become difficult to find the data you want&lt;br /&gt;
&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>a.k.a. The Kitchen Sink Design Pattern</p>
<p>Problem:<br />
The data requirements keep changing but the interface must remain constant.</p>
<p>Solution:<br />
1. Create a kitchen sink for storing an unlimited number of objects of any type<br />
2. Create one interface with one method that accepts and returns the kitchen sink<br />
3. Implement the same interface in all services and across all layers everywhere</p>
<p>Strategy:<br />
Implement the kitchen sink using a HashMap.</p>
<p>Forces:<br />
When the domain model does not matter and you just want quick and dirty access to any data from anywhere.</p>
<p>Pros:<br />
- The interface will never change<br />
- The kitchen sink can never be full</p>
<p>Cons:<br />
- Can grow very large<br />
- Serialization can be expensive<br />
- Synchronization can become unmanageable<br />
- Data can become volatile<br />
- Can become difficult to find the data you want</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.pathf.com/blogs/2008/03/anti-patterns-i/#comment-86</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Wed, 05 Mar 2008 00:55:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=68#comment-86</guid>
		<description>&lt;p&gt;This is how most loosely typed languages work.  Every object is a Map more or less.  Passing around HashMaps is just a way of working around Java's strong typing.  It can be abused quite easily of course. The problem arises when the required data for a function become ambiguous because they are all hidden inside a map and not in the method signature.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is how most loosely typed languages work.  Every object is a Map more or less.  Passing around HashMaps is just a way of working around Java&#8217;s strong typing.  It can be abused quite easily of course. The problem arises when the required data for a function become ambiguous because they are all hidden inside a map and not in the method signature.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Moscoso</title>
		<link>http://www.pathf.com/blogs/2008/03/anti-patterns-i/#comment-85</link>
		<dc:creator>Ivan Moscoso</dc:creator>
		<pubDate>Tue, 04 Mar 2008 13:45:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=68#comment-85</guid>
		<description>&lt;p&gt;Good point, Harry.  I think it's important to understand the motivations behind the scenes.&lt;/p&gt;

&lt;p&gt;That said, even if one were to apply this to some code, it can't happen without keeping it tightly scoped and on a very short leash.  And even then it adds quite a bit of technical debt.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Good point, Harry.  I think it&#8217;s important to understand the motivations behind the scenes.</p>
<p>That said, even if one were to apply this to some code, it can&#8217;t happen without keeping it tightly scoped and on a very short leash.  And even then it adds quite a bit of technical debt.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HarryC</title>
		<link>http://www.pathf.com/blogs/2008/03/anti-patterns-i/#comment-84</link>
		<dc:creator>HarryC</dc:creator>
		<pubDate>Mon, 03 Mar 2008 18:27:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=68#comment-84</guid>
		<description>&lt;p&gt;&gt; ...the typical set of problems you find dealing with global variables&lt;/p&gt;

&lt;p&gt;&gt; ...a reaction to an unwieldy or overly-stateless architecture&lt;/p&gt;

&lt;p&gt;I've seen this often when you're down to crunch-time and you need a high-level piece of data way down in the call-stack (or vice-versa) and you just can't change 1000 method signatures to include the parameter(s) by sunrise.  So, you fall victim to this sort of thing.&lt;/p&gt;

&lt;p&gt;Another variant:  Passing Parameters as a HashMap, similar to:&lt;/p&gt;

&lt;p&gt;void foo( Map params )&lt;/p&gt;

&lt;p&gt;That will bite you eventually, as well.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>> &#8230;the typical set of problems you find dealing with global variables</p>
<p>> &#8230;a reaction to an unwieldy or overly-stateless architecture</p>
<p>I&#8217;ve seen this often when you&#8217;re down to crunch-time and you need a high-level piece of data way down in the call-stack (or vice-versa) and you just can&#8217;t change 1000 method signatures to include the parameter(s) by sunrise.  So, you fall victim to this sort of thing.</p>
<p>Another variant:  Passing Parameters as a HashMap, similar to:</p>
<p>void foo( Map params )</p>
<p>That will bite you eventually, as well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
