Advice on how to best handle a long list of attributes

The Web BlueTooth API currently specifies interfaces that serve as lookup tables for values [1], which can lead to code that looks like this (extreme example):

```
//returns a UUID string
navigator.bluetooth.uuids.catalytic_activity_concentration.katal_per_cubic_metre
```

Clearly, that's not ideal to type out. I'm wondering if anyone has some recommendations of how we can clean this up a bit. We've thrown around some ideas [2], like using a WebIDL [MapClass] to look up values using enums:

```
BluetoothUnitMap.get("katal_per_cubic_metre"); 
```

or exposing things like the above as static constants on interface objects:

```
BluetoothUnitMap.catalytic_activity_concentration.katal_per_cubic_metre
```

... but nothing feels quite right :/

Can anyone think of a better way of approaching this problem? Maybe it doesn't matter? 


[1] https://webbluetoothcg.github.io/web-bluetooth/#standard-gatt-units
[2] https://github.com/WebBluetoothCG/web-bluetooth/issues/49

Received on Thursday, 25 September 2014 23:12:26 UTC