On 7/5/11 8:32 AM, Sergey Beryozkin wrote:
>>>> Remove the invoke() and queue() methods. This way get, post, et. al.
>>>> is always invoked last to trigger the actual invocation.
>>>>
>>> Lets keep get()/etc with Link and have get()/etc finishing the chain,
>>> and have Link optionally creating an initialized Invocation which will
>>> do its invoke().
>>>
>>> IMHO Link is an HTTP-centric thing and it should do get().
>>>
>>
>> I disagree. Link should be a request factory, thats it. If you have
>> anything even slightly complex, an Invocation will need to get created
>> anyways, i.e. if the Link is a uri with path parameters or if you want
>> to set a specific query parameter. Also, with a post, or put you'll
>> want to set the entity body, form parameters, etc. Besides all you're
>> saving is:
>>
>> link.request().get();
>>
>> vs.
>>
>> link.get()
>>
>> Not a big deal, IMO.
>
> link.get().invoke() is a big deal IMHO :-)
>
> Of course I was not assuming only plain get() can be done. Current API
> is Invocation-centric. And Invocation is primarily there to accommodate
> batch-processing and such. I'd like to see Invocation not visible at all
> except for those users who know why they need Invocation.
>
And I'm saying that most users will need to interact with an Invocation:
to set path parameters, query parameters, headers, entity bodies, etc.
Having multiple ways to do the same exact thing increases complexity and
confusion. I just don't see yet how stuffing additional methods into
Client/Link will make things much simpler.
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com