<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 19 May 2010, at 17:35, Sanne Grinovero wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p>Is this covering a different use case than having two caches k1 and k2 equally configured?<br>
My current app Scarlet is dynamically creating many different caches using the configuration names asd templates, I'm happy with that.</p><div><br></div></blockquote><div><br></div><div>Slightly different. &nbsp;Scoping could be useful for use cases where creating a cache per scope is too expensive. &nbsp;E.g., I want to cache a person's name, address and photograph. &nbsp;I could do this:</div><div><br></div><div>cache.put("person1_name", name);</div><div>cache.put("person1_address", address);</div><div>cache.put("person1_pic", pic);</div><div><br></div><div><div>cache.put("person2_name", name);</div><div>cache.put("person2_address", address);</div><div>cache.put("person2_pic", pic);</div><div><br></div><div><div>cache.put("person3_name", name);</div><div>cache.put("person3_address", address);</div><div>cache.put("person3_pic", pic);</div><div><br></div><div>and every time I need to retrieve anything I need to concatenate person_id with the "field" I am interested in. &nbsp;It would be too expensive to create a separate cache per person, as the system may have thousands of users.</div><div><br></div><div><br></div><div><br></div></div></div><div><br></div><div><br></div><br><br><blockquote type="cite"><div><br class="webkit-block-placeholder"></div><blockquote type="cite">Il giorno 19/mag/2010 16:43, "Manik Surtani" &lt;<a href="mailto:manik@jboss.org">manik@jboss.org</a>&gt; ha scritto:<br><br><p><font color="#500050"><br>On 13 Apr 2010, at 11:01, Manik Surtani wrote:<br>
<br>&gt; </font></p><p><font color="#500050">&gt; On 13 Apr 2010, at 10:50, Sanne Grinovero wrote:<br>&gt; <br>&gt;&gt; rightfull concern, I wouldn't personally ha...</font></p>Here is an alternative - *do* we want to support scoping? &nbsp;By this, I mean:<br>

<br>
cache.withAffinityKey("k1").put("name", "Manik");<br>
cache.withAffinityKey("k1").put("country", "UK");<br>
<br>
cache.withAffinityKey("k2").put("name", "Sanne");<br>
cache.withAffinityKey("k2").put("country", "IT");<br>
<br>
will be allowed and the two will not overwrite each other, *but* you cannot retrieve stuff by simply doing:<br>
<br>
cache.get("name") anymore. &nbsp;You would have to do:<br>
<br>
cache.withAffinityKey("k1").get("name"). &nbsp;Simply doing a cache.get("name") will return a null.<br>
<br>
What do people prefer?<br>
<br>
Cheers<br>
<font color="#888888">Manik<br>
</font><p><font color="#500050"><br>--<br>Manik Surtani<br><a href="mailto:manik@jboss.org">manik@jboss.org</a><br>Lead, Infinispan<br>Lead, JBoss Cache<br><a href="http://www.infinispan.org/">http://www.infinispan.org</a><br>
http:...</font></p></blockquote><div><br class="webkit-block-placeholder"></div>
_______________________________________________<br>infinispan-dev mailing list<br><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/infinispan-dev</blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div>Lead, Infinispan</div><div>Lead, JBoss Cache</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><a href="http://www.jbosscache.org">http://www.jbosscache.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></body></html>