You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Brad Neuberg <bk...@columbia.edu> on 2004/10/20 03:15:39 UTC

[feedparser] Design changes

I am in the process of making some design changes for the Jakarta Feed 
Parser; I just wanted to run them by folks to see what people think.  They 
fall into three broad categories:

* Changes to the build system
* Changes to the unit testing code
* Changes to the core design

First, I would like to make the following changes to the current build system:
    * Change build.xml to use a build.properties file for the following two 
properties (I've already made these changes locally)
       * feedparser.home - The location of the feed parser installation; 
defaults to ".".  Needed so that we can update our unit tests to run 
cross-platform (they currently only run on Kevins Linux box :)
       * ext.lib.path - The location of external JARs needed by the feed 
parser but which are not included, such as junit.jar.  The location to 
these used to be hard coded in the build.xml file, which is nasty and 
doesn't work cross-platform.
    * Add help to the build.xml file - I've already made these changes 
locally - essentially this is an ant task, 'help', that provides 
information on the available tasks and how to configure your system to get 
the feed parser to work.
    * Add ant-contrib.jar to the lib directory and wire it in.  Ant-contrib 
is a nice collection of advanced ant tags, such as an if tag, that can help 
to make more maintainable ant files.  It is opensource.
    * Clean up the unit testing targets.  Right now we have several testing 
targets that aren't rationalized.  Locally I've created a single task, 
"test", that by default runs every available task.  This task allows an 
optional argument, "test.only.local", that will only test the local tasks 
and not the remote ones so that they run faster (Kevin asked for this).

The second set of changes has to do with the unit testing code:
    * Several of the tasks are hardwired to paths that only work on Kevins 
system.  I would like to have them load a Java system property, 
"feedparser.home", that is set by the Ant tasks above before running so 
that these tests will work on Windows.
    * Kevin added some code for two kinds of weblog services that have RSS 
"pecularities": Yahoo Groups and Flickr.  I would like to add tests for 
these two types

The third set of changes are the largest.  Currently we have an object 
named BlogService that encapsulates the kind of BlogService we are dealing 
with, such as Flickr, Blogger, etc.  This was needed because many services 
have pecularities that differ from the RSS spec, unfortunately; we still 
need to work with them though.

Right now we have two classes, BlogServiceDiscovery and 
ProbeLocator.  These two classes use the BlogService that is discovered to 
attempt to find a feed through aggresive probing if aggresive probing is 
enabled.  Lots of code that is blog-service specific is exposed in these 
classes, which breaks down for two newer "problem" services, Flickr and 
Yahoo Groups.

I would like to invert the control as follows.  Every BlogService object 
will encapsulate how to find its particular feed and how to discover if a 
given URL is of that BlogService type.  The BlogServiceDiscovery and 
ProbeLocator classes will then use the visitor pattern, "asking" the 
BlogService object to see if it is that type and to locate its feed.  This 
will significantly clean up the BlogServiceDiscovery and ProbeLocator code, 
and will also make it possible to support services that need more advanced 
workarounds, such as Flickr.  We will subclass the BlogService class for 
each type of BlogService, and they will be contained inside of 
org.jakarta.feedparser.locate.blogservice.  So we would have 
org.jakarta.feedparser.locate.blogservice.Flickr, 
org.jakarta.feedparser.locate.blogservice.Blogger, etc.



Brad Neuberg, bkn3@columbia.edu
Senior Software Engineer, Rojo Networks
Weblog: http://www.codinginparadise.org

=====================================================================

Check out Rojo, an RSS and Atom news aggregator that I work on.  Visit 
http://rojo.com for more info. Feel free to ask me for an invite!

Rojo is Hiring!  If you're interested in RSS, Weblogs, Social Networking, 
Java, Open Source, etc... then come work with us at Rojo.  If you recommend 
someone and we hire them you'll get a free iPod!  See 
http://www.rojonetworks.com/JobsAtRojo.html. 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org