Re: [contacts-manager-api] Preferred ContactField

On 22/03/13 11:41, Christophe Dumez - SISA wrote:
> Hi,
> 
> While we could make the "preferred" attribute an integer instead of a boolean to fully conform to the vCard v4 format. My personal opinion is that using a boolean would be a good compromise:
> - It conforms with the "Pick Contacts Intent" API [1]
> - It is mostly compatible with vCard v4 (basically a subset)
> - It is compatible with vCard v3
> - We have a clean separation between type and preferred state
> - Using a boolean is not as complex as using an integer.

I do not think that trying to be compatible with Pick Contacts Intent
should be a goal at this point. This should happen the other way around:
the Contacts API should define how the data is represented and the Pick
Contacts Intent specification should reflect that.

I know that Mozilla's Contacts API has been designed to be compatible
with vCard but I would consider this a non-goal too. In my opinion we
should try to understand why vCard did something in a way or another and
learn from their experience but doing something that isn't Web-y or even
that we disagree with because vCard did it this way seems to be a bad idea.

Generally speaking, I think the integer approach is probably better than
the boolean approach but I do not know if that is the best approach. I
see at least one use case that a boolean approach wouldn't handle well:
I have some contacts that have multiple phone numbers and depending on
my current location and their current location, the preferred number
will change. Using a boolean to know the preferred number will not help
the application to know which number to use at a given moment. Using an
integer might help the consumer of the API to know that if I'm currently
in a given country, I might prefer to use the number for that country
even if its preference rating is a bit lower than another number.
However, this solution requires quite a bit of interpretation from the
application. I wonder how we could improve that.

Cheers,
--
Mounir

Received on Monday, 25 March 2013 15:01:25 UTC