abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergio Bossa" <sergio.bo...@gmail.com>
Subject Refactoring AbstractProvider to make it open for extension
Date Fri, 04 Jul 2008 17:43:44 GMT
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.


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

View raw message