On Wed, Jun 18, 2008 at 5:04 PM, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote: > I have two use cases in mind where this would be useful: > > 1) Generating different flavors of JSON output, probably based on selectors > > 2) Allowing scripts to reuse part of the POST servlet functionality, > while customizing part of the POST request processing.
Agreed. So far I haven't seen another use case, too. Although there might be some... > I think 1) is fairly easy to solve by making the JsonRendererServlet > more expandable, maybe simply factoring out the instantiation of the > JsonItemWriter so that people can provide custom variants, by > registering servlets that extend JsonRendererServlet. I think this > "standard rendering customization" only makes sense for the JSON > format currently, so no need for a generalized framework. Sounds good. > Solving 2) looks like a different problem, where the SlingPostServlet > functionality might need to be broken down in smaller services and > components that scripts can reuse in a modular way. I would try to make it extendable (in the OO-sense). That would be consistent with 1) and is IMHO the natural choice in Java. Having to register a new set of services seems like overkill to me. Although this doesn't allow scripts as a replacement for the post servlet - at least if you don't want to copy the code. > I don't see other use cases for customizing our standard servlets at > the moment, so I feel the above two cases can be handled "locally" > without creating a generalized (and possibly complex) customization > framework. That was my point: I don't want a complex customization framework. A simple and consistent way like inheritance is good, I think. Regards, Alex -- Alexander Klimetschek [EMAIL PROTECTED]
