On Mar 12, 2014, at 17:45, Galder Zamarreño <galder(a)redhat.com> wrote:
On 05 Mar 2014, at 18:16, Mircea Markus <mmarkus(a)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 :\
Cheers,
--
Mircea Markus
Infinispan lead (
www.infinispan.org)