7.2  Calling by Interface

7.2.1  Interfaces

When applets make use of a control, they are interested in its functionality, not its particular implementation. It doesn't matter which control gets loaded as long as the control does exactly what was expected.

The functionality is described by interfaces and several implementations of an interface can exist. However, control authors have to make sure that two different implementations of the same interface provide the same functionality.

7.2.2  Unique Identifiers

To avoid confusion and incompatibility problems, interface identifiers have to be globally unique. You don't have to worry about this requirement, however, because gDesklets takes care about this for you. It determines the identifier for each interface and makes sure that changes in an interface lead to a different unique identifier.

The interface identifiers are made up of a human-readable name given by the interface's author, and a random-looking string. That string is based on a checksum of the interface and is affected by all changes to the interface, except for changes in comments.

The identifiers might look intimidating at first, but there is no magic behind them and the only occasion when you get into touch with them is when you want to load a control in an applet. In that case, just use copy&paste.

Examples for interface identifiers are:

ICalendar:cfw9o85ptery8egvoff6ijswc
ISystem:4i4p0jtvdz87qx44x2dm97ltj
ITime:9y703dqtfnv4w373caserz68r
  

They can be looked up in the gdesklets-shell, or by using the tool test-control.py. There's no need to take care about the identifier while writing a control.