convert an object to a descriptor