GData Overview

## GData Overview GData Overview — overview of libgdata's architecture |

## Introduction

libgdata is a library to allow access to web services using the GData protocol from the desktop. The GData protocol is a simple protocol for reading and writing data on the web, designed by Google.

### Protocol

The GData protocol is designed by Google to allow interaction with their web services. It is based on the Atom Publishing protocol, with namespaced XML additions. Communication between the client and server is broadly achieved through HTTP requests with query parameters, and Atom feeds being returned with result entries. Each service has its own namespaced additions to the GData protocol; for example, the Google Calendar service's API has specialisations for addresses and time periods.

Figure 1.

An overview of the data flow when making a request of a GData service.

Results are always returned in the form of result feeds, containing multiple entries. How the entries are interpreted depends on what was queried of the service, but when using libgdata, this is all taken care of transparently.

### Structure

The basic design of libgdata mirrors the protocol's structure quite closely:

Figure 2.

An overview of the libgdata class structure.

GDataService | Subclassed for each different web service implemented, this class represents a single client's connection to the relevant web service, holding their authentication state, and making the necessary requests to read and write data to and from the service. All top-level actions, such as creating a new object on the server, are carried out through a service. There should be one GDataService subclass for each of the services listed in the GData documentation.
GDataQuery | For queries to have multiple individual parameters, a GDataQuery can be used to specify the parameters. Query objects are optional, and can only be used with queries (not with entry insertions, updates or deletions). The query object builds the query URI used by the GDataService when sending the query to the server. Services can subclass GDataQuery if the service supports non-standard query parameters.
GDataFeed | Effectively a list of GDataEntrys, the GDataFeed class is a direct counterpart of the root <feed> element in the Atom feeds which form the GData protocol. It contains the elements in a query response, as well as general information about the response, such as links to related feeds and the categories under which the query response falls. GDataFeed is usually not subclassed by services, as there are rarely service-specific elements in a feed itself.
GDataEntry | A GDataEntry is a direct counterpart of the <entry> element in the Atom feeds which form the GData protocol. It represents a single object of unspecified semantics; an entry could be anything from a calendar event to a video comment or access control rule. Semantics are given to entries by subclassing GDataEntry for the various types of entries returned by queries to a service. Such subclasses implement useful, relevant and query-specific properties on the entry (such as the duration of a video, or the recurrence rules of a calendar event).