[ZOOM] Extending ZOOM C++

Adam Dickmeiss adam at indexdata.dk
Thu Nov 1 21:43:38 CET 2001


On Thu, Nov 01, 2001 at 03:32:58PM +0000, Ashley Sanders wrote:
> Adam, Mike,
> 
> > I thought this was not such a big issue, but it's essential. The search
> > method in its current form doesn't allow that you specialize your
> > resultSet (inherit from it). Let me show some code. I hope it
> > speaks for itself.
> >
> > class smartSet : public resultSet {
> > public:
> >     smartSet(connection *c, query *q);
> > };
> > 
> > smartSet::smartSet(connection *c, query *q) : resultSet(c, q)
> > {
> >     // stuff for my smartSet
> > }
> > 
> > record *give_me_targetinfo3 (connection *c)
> > {
> >     prefixQuery q("@attr exp1 1=1 targetinfo");
> >     smartSet (c, &q);                    // works

Typo:   smartSet s0(c, &q);

> >     smartSet *s = new smartSet(c, &q);   // works too
> >     smartSet *s1 = c->search(&q);        // works not
> >     record *rec = s->getRecord(0);       // works (with smartSet)
> >     // not deleting ... TODO
> >     return rec;
> > }
> > 
> 
> Indeed. What you've suggested above and what we now seem to be
> converging on is getting very similar to my COPAC origin. The one
> major difference we between ZOOM and COPAC is the connection
> object. And I'm throwing this in now as we seem to be in the mood
> for changing everything. The ZOOM connection object is a single
> connection to one target. In COPAC the connection object can talk
> to more than one target. So when a resultSet object is created
> the connection object sends the search to as many targets as
> specfied by the query. Do we want to go down this route Mike?
> 
> Is it also worth defining a protocol class for a resultSet
> heirarchy -- ie as base class from which all resultSet classes
> are derived?

We could consider an abstract result set class. That is we
define an interface that all result sets expose. Then do the
same thing for connections and records. Having said that, I
think that's going somewhat too far, for now. It also makes
it even more painful to discuss other language bindings (except
for Java, perhaps). So I won't say anymore on this until I'm
forced to;)

Even without abstract classes and changes to the ZOOM C++ binding,
it would be relatively easy to make a smartSet that takes one
query and multiple connections in the constructor resulting in one
"virtual" result. Then add a new method, getRecordSource, that
returns from which target a particular record was retrieved from.
There are tons of other ways. This is just one of them.

-- Adam

> Ashley.
> 
> -- 
> Ashley Sanders                                a.sanders at mcc.ac.uk
> COPAC: A public bibliographic database from MIMAS, funded by JISC
>              http://copac.ac.uk/ - copac at mimas.ac.uk
> _______________________________________________
> ZOOM mailing list
> ZOOM at indexdata.dk
> http://www.indexdata.dk/mailman/listinfo/zoom

-- 
Adam Dickmeiss  mailto:adam at indexdata.dk  http://www.indexdata.dk
Index Data      T: +45 33410100           Mob.: 212 212 66



More information about the ZOOM mailing list