HAL 0.1 release

Havoc Pennington hp at redhat.com
Sat Oct 11 01:14:34 EEST 2003


There are two kinds of information. On the one hand a "class hierarchy"
of devices:

     Device -> Network Device -> Modem -> Hayes-compatible Modem

On the other hand, for a particular device instance, what classes is it
a member of.

The simplest solution is to list all classes if the device is an
instance of the class:

 Category = Device, Network, Modem, HayesModem

Of course you can drop Device since that's a given.

If you somewhere stored the class hierarchy, you could list only
HayesModem, and the parent classes would all be implied. Then you only
need to list the most-derived or leaf classes applying to the device.
However, this is probably pointless complexity (introduces an "interface
repository" that stores all possible categories). 

So if you want to avoid storing the hierarchy somewhere, you can just
list them all.

Having Category and SubCategory seems broken due to the 0, 1, or N rule.
Why only 2 levels of inheritance? The simple HayesModem example already
has 3.

Another option is for each device to have:
 Interfaces = Modem, HayesModem, Network, Disableable, PCIDevice

And each interface in the list implies that specific properties will be
present. There would then be no separate "device category", to get all
cameras you just check for devices that support camera operations. 
On the down side, maybe sometimes you'd have empty interfaces existing
just so you can see if the device is_a particular sort of thing.

BTW, for the icon problem - I'd expect devices to have an Icon property,
returning an icon name to be looked up using the icon theme spec.

Just some thoughts, I may well be wrong.


More information about the xdg mailing list