[infinispan-dev] Design change in Infinispan Query

Galder Zamarreño galder at redhat.com
Fri Mar 14 05:30:53 EDT 2014


On 13 Mar 2014, at 10:48, Mircea Markus <mmarkus at redhat.com> wrote:

> 
> On Mar 12, 2014, at 17:45, Galder Zamarreño <galder at redhat.com> wrote:
> 
>> 
>> On 05 Mar 2014, at 18:16, Mircea Markus <mmarkus at redhat.com> wrote:
>> 
>>> If anything, this model reduces type safety and reusability. E.g. say you want a M/R task to see how many Persons speak French. With the single cache model(both Dog and Person int he Cache<String, Mammal>) it would look something like:
>>> 
>>> a)
>>> //pseudocode
>>> map (String k, Mammal value) {  
>>> if (value instanceof Person)) { //this is the ugly part
>>> 	if  (((Person)value).speaks("French")) ...
>>> } else {
>>>   //ignore it, it's an Dog
>>> }
>>> }
>>> 
>>> Same thing written for a Cache<String, Person>:
>>> 
>>> b)
>>> map (String k, Person value) {
>>> if  (value.speaks("French")) ...
>>> }
>>> 
>>> I don't think people would prefer writing a) instead of b) ;)
>> 
>> It’s a pity that having discussed in Mallorca and having referenced a fair few times already, you could not think of an option based on what Paul suggsted in https://issues.jboss.org/browse/ISPN-3640
> 
> Not sure what you want to imply with that, it was an oversight on my side :\

That’s ok, happens to all. Sorry :)

> 
> Cheers,
> -- 
> Mircea Markus
> Infinispan lead (www.infinispan.org)
> 
> 
> 
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


--
Galder Zamarreño
galder at redhat.com
twitter.com/galderz

Project Lead, Escalante
http://escalante.io

Engineer, Infinispan
http://infinispan.org




More information about the infinispan-dev mailing list