I'm not sure what things you want to do with the request processing that force you to replace the 'if' statements that you mention. There are other ways to do this in Abdera so maybe you're just focused in the wrong place. If you want to manage how urls and params are resolved, as I do, you could work with the RouteManager. Or you could add a custom TargetResolver. There are also Abdera Filters, that allow you to apply some logic to every request (I still am not sure at which point filters are applied but I think it's after The RequestContext is built and the first run of target resolution has happened).
My understanding of how Abdera should work is that you should put all the logic you need into creating enough targets to cover all your main use cases and then use logic in your adapters or filters to do request handling that applies to all requests. This could be OpenSearch, but I've not looked at it in detail yet. I'm still interested in seeing your new class in any case. davep On Fri, Jul 4, 2008 at 10:43 AM, Sergio Bossa <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm working on a large project which will extensively use Apache Abdera. > We will have to support the OpenSearch (OS from now on) specification, > so while trying to enhance Abdera support for OS, I saw that the > AbstractProvider class, which is the core of the whole server > infrastructure, is poorly implemented as a bunch of "if" statements > depending on the TargetType for actual request processing. > This makes very hard to add request processing features to the > AbstractProvider, because it forces you to modify the class itself by > adding more and more "if" statements. > That said, I've refactored the AbstractProvider class, removed all > "if" statements and added the concept of "RequestProcessor", a > strategy-like interface to implement for request processing logic: by > doing so, adding request processing logic is just a matter of > implementing an interface and registering it under a given TargetType. > I've tested my work against all Abdera unit tests and everything works fine. > > What do you think about that? > If you think it could be useful, I'd be more than happy to contribute it. > > Cheers, > > Sergio B. > > -- > Sergio Bossa > Software Passionate, Java Technologies Specialist and Open Source Enthusiast. > Blog : http://sbtourist.blogspot.com > Sourcesense - making sense of Open Source : http://www.sourcesense.com > Pro-netics s.p.a. : http://www.pronetics.it >
