abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James M Snell <jasn...@gmail.com>
Subject Re: svn commit: r468598 - in /incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/opensearch: OpenSearchV11Helper.java Query.java
Date Sat, 28 Oct 2006 17:29:53 GMT
I agree it's less than ideal.  Here's one approach that could possibly
work (but caries a bit of additional overhead in the implementation).

For extension elements, the FOMBuilder could always create a FOMElement
instance, then pass that off to ExtensionFactory which would return an
ElementWrapper instance.  ElementWrapper would implement the Element
interface.  The various getExtension methods on ExtensibleElement would
need to be capable of wrapping and unwrapping the element as necessary
meaning that we'd have to keep track of the QName-to-ExtensionFactory
mapping. Extension Implementors would then need only to extend
ElementWrapper to implement their stuff.

Shouldn't take too long to code up.

- James

Garrett Rooney wrote:
> On 10/27/06, jmsnell@apache.org <jmsnell@apache.org> wrote:
> 
>> OpenSearch v1.1 feed extension element implementation.  This
>> demonstrates an alternative approach
>> to handling extension elements that is independent of the underlying
>> Axiom implementation. The
>> other OpenSearch v1.0 stuff should be refactored to match this.
> 
> I'm not sure I like this new approach.  On one hand, yes, it does
> allow manipulation of extension elements without knowledge of the
> underlying parser implementation.  On the other, it means that you
> have to treat the extension elements specially, where a big part of
> what I like about Abdera is that extension elements can be treated
> just like any other type of element.  If we're going to migrate to a
> non-axiom based parser anyway, is it really necessary to bend over
> backwards this way to break the connection?  It seems like we should
> be able to make the parser implementation unaware of the exact
> implementation class used for a given Element, with a little bit of
> work.
> 
> -garrett
> 

Mime
View raw message