jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: Updated Client API and Interceptors/Filters proposal is available - please review

From: Markus KARG <markus_at_headcrashing.eu>
Date: Mon, 13 Jun 2011 19:12:51 +0200

Proposals:

(A) Injection

@X private ClientFactory cf;

(where X will be an annotation defined by the JAX-RS specification and has the sole job of letting the actual implementation decide which actual factory class to take)

(B) Delegation

private ClientFactory cf = RuntimeDelegate.buildClientFactory();

(which in fact moves the problem to the right, topmost place)


Regards
Markus

> -----Original Message-----
> From: Marek Potociar [mailto:marek.potociar_at_oracle.com]
> Sent: Montag, 13. Juni 2011 15:16
> To: jsr339-experts_at_jax-rs-spec.java.net
> Cc: Markus KARG
> Subject: Re: [jsr339-experts] Re: Updated Client API and
> Interceptors/Filters proposal is available - please review
>
> On 06/13/2011 02:46 PM, Markus KARG wrote:
> > For the topic of factories itself I share Bill's opinion that
> whenever possible we should use interfaces and do not provide
> implementations. As much as possible of the implementation should be in
> the sole hands of the vendors and not already pre-programmed by the
> spec. If using a ClientFactory is the solution, then we should provide
> one. It's just the cleaner approach.
>
> Can you please provide an example of constructing a client instance
> with the client factory you propose? Does your
> client factory have static methods? If yes, it must be at least an
> abstract class then, which means we are just moving
> the problem one level of indirection further. If no, how do you plan to
> get the client factory instance just using the
> JAX-RS API?
>
> Thanks,
> Marek