You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Oliver Lietz <ap...@oliverlietz.de> on 2021/10/06 08:28:37 UTC

Re: Add builders to create request/response objects

On Wednesday, 29 September 2021 18:40:39 CEST Carsten Ziegeler wrote:
> Hi,
> 
> in https://issues.apache.org/jira/browse/SLING-10840 we have some
> lengthy discussion about the servlet helpers bundle, where and how it
> should be used and the problem with it implementing ProviderType interfaces.
> 
> The gist of it, is that the main purpose of this bundle is to be used in
> tests. It provides mocks for several things.
> Due to it implementing ProviderType it is a little bit more dangerouns
> to use it in production as it constantly needs to be updated whenever
> the Sling api changes (the relevant packages have changes).
> 
> Now, as suggested in that ticket, we should probably have some proper
> API to create an initial request and response without backing it out or
> wrapping an existing request / response.
> 
> The suggestion is to provide two builder classes (similar or same) as in
> the servlet helpers bundle but make it more prominent. All required
> implementation classes would be private.
> 
> We could either move these to the API bundle, where the interfaces are
> defined. Or to the Engine bundle which contains the processor interface
> which is probably the most common use case for these.
> 
> I don't have any real preference, API is probably the better location as
> this is general purpose functionality which can be used without the
> processor.
> 
> WDYT?

+1 for builders in API bundle

O.

> Regards
> Carsten