backends need some OO loving

Andrew Turner ajturner at highearthorbit.com
Thu Aug 2 15:20:49 PDT 2007


well, another reason python is nicer - the entire backend can be like
10 lines of code ;)

However, for C, your suggestion sounds nice. Other backends wouldn't
be required to use this structure, but developers could more easily
implement their own if they derive from the WebServices class.


On 8/2/07, Jussi Kukkonen <jhkukkon at cc.hut.fi> wrote:
> 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
>
>
> _______________________________________________
> GeoClue mailing list
> GeoClue at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/geoclue
>
>
>


-- 
Andrew Turner
ajturner at highearthorbit.com      42.2774N x 83.7611W
http://highearthorbit.com              Ann Arbor, Michigan, USA
Introduction to Neogeography - http://oreilly.com/catalog/neogeography


More information about the GeoClue mailing list