[infinispan-dev] Making confusion between different remove() APIs
Emmanuel Bernard
emmanuel at hibernate.org
Tue Nov 3 14:15:36 EST 2009
On 3 nov. 09, at 19:03, Galder Zamarreno wrote:
>
>
> On 11/03/2009 05:37 PM, Manik Surtani wrote:
>> On 3 Nov 2009, at 16:31, Emmanuel Bernard<emmanuel at hibernate.org>
>> wrote:
>>
>>> Another option is to use a fluent API
>>> blah.usingContext().flags(FOO,BAR).remove();
>>
>> Hmm, that's a possibility. Maybe cache.withFlags(FOO,BAR).remove(key)
>> where withFlags() returns a Cache.
>>
>> Wdyt, guys?
>
> Interesting idea Emmanuel, seems like you're quite fond of fluent
> APIs :)
>
> I'd stick with single word flags(), i.e.:
>
> cache.flags(FOO,BAR).remove(key)
>
> flags() looks explicit enough to me.
The reason I use usingContext() is for future extensibility. I don't
know your API well enough to know if that's necessary.
Do you need both flags and hints for example?
Do they apply for a single operation or many operations?
In the latter case I would do
Cache cache = CacheManager
.usingContext()
.flags(BOO)
.hints("faster")
.getCache();
More information about the infinispan-dev
mailing list