Martin Grotzke wrote:
>> In this respect we can use Java and the builder pattern as a tiny DSL
>> for configuration.
> Ok, agreed. I'll change this accordingly.
>
Thanks!
> Do you think we should only provide WadlGeneratorConfig and drop the
> WadlGeneratorConfiguration interface? I'd say we can still keep this
> interface, so that users might provide completely different
> implementations.
>
I would be inclined to allows developers to extend WadlGeneratorConfig
and override the existing functionality i.e. lets add the interface if
we have a concrete use-case for it otherwise let's try and keep it as
simple as possible.
>>> - You can use the WadlGeneratorConfig for configuration at runtime:
>>>
>>> - Direct instantiation of WadlGenerators: final WadlGeneratorConfig
>>> config = WadlGeneratorConfig.generator( new MyWadlGenerator()
>>> ).build(); final ResourceConfig resourceConfig = new
>>> DefaultResourceConfig(); resourceConfig.getProperties().put(
>>> ResourceConfig.PROPERTY_WADL_GENERATOR_CONFIG, config );
>>>
>>> - Configure WadlGenerators: final WadlGeneratorConfig config =
>>> WadlGeneratorConfig .generator( MyWadlGenerator.class.getName() )
>>> .prop( "foo", propValue ) .add() .generator(
>>> MyWadlGenerator2.class.getName() ) .prop( "bar", propValue2 ) .add()
>>> .build(); final ResourceConfig resourceConfig = new
>>> DefaultResourceConfig(); resourceConfig.getProperties().put(
>>> ResourceConfig.PROPERTY_WADL_GENERATOR_CONFIG, config );
>>>
>> Why not refer to the classes directly as follows:
>>
>> final WadlGeneratorConfig config = WadlGeneratorConfig
>> .generator( MyWadlGenerator.class )
>> .prop( "foo", propValue )
>> .add()
>> .generator( MyWadlGenerator2.class )
>> .prop( "bar", propValue2 )
>> .add()
>> .build();
>>
>> i.e. the more static typing we can utilize the less errors we need to
>> check and report.
> Also a good point :)
>
>>
>>> @Paul: do you want to have a look at this? What about the impl
>>> namespace? Do you think this is ok, or should this stuff go into spi?
>>>
>> I think the WadlGeneratorConfig should be part of the API.
> So I'll rename com.sun.jersey.impl.wadl.config to
> com.sun.jersey.api.wadl.config.
>
OK.
Paul.
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109