backends need some OO loving

Jussi Kukkonen jhkukkon at cc.hut.fi
Thu Aug 2 08:39:15 PDT 2007


Hello,

This is mostly a note to self (I'm going golfing for the weekend and
knowing my memory I'll probably forget geoclue even exists by monday),
but help would be nice too: I'm not very familiar with gobject-based OO,
so any comments from anyone more experienced would be great.

While working on the web service based positioning backends, I've become
worried about the maintainability of the current backends... There is a
lot of copy-paste code and redundancy (as an example GeocluePosition is
defined in four header files with almost the same contents). I talked to
Keith briefly and we agreed that the backends probably need a little work.

While there's no reason (API-wise) for the backends to all inherit from
a single class, I believe it would be smart: otherwise the
OO-implementation is just more code without much benefit. In addition to
an abstract position backend class, I'm thinking there should be an
abstract web service position backend class (containing http-client, xml
parsing and connectivity event monitoring code).

Like this:

  GeocluePosition (abstract, contains API and maybe helper functions)
   |
   +- GeocluePositionGpsd
   |
   +- GeocluePositionManual
   |
   +- GeocluePositionWebservice (abstract)
       |
       +-GeocluePositionPlazes
       |
       +-GeocluePositionHostip

That might look like overdoing it, but I have the feeling plazes and
hostip are not going to be the last web service based backends...

-jussi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 307 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/geoclue/attachments/20070802/ea6756c3/attachment.pgp 


More information about the GeoClue mailing list